Skip to content

Commit e46c21f

Browse files
authored
fix: issue with select for angular not using initial value (#4136)
1 parent 791f305 commit e46c21f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/components/scripts/post-build/components.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,19 @@ export const getComponents = (): Component[] => [
222222
}
223223
}
224224
},
225-
226225
{
227226
name: 'select',
228227
overwrites: {
229-
angular: [{ from: '<HTMLElement>', to: '<HTMLSelectElement>' }],
228+
angular: [
229+
{ from: '<HTMLElement>', to: '<HTMLSelectElement>' },
230+
// TODO: We can move this to onMount with useTarget after https://github.com/BuilderIO/mitosis/pull/1750 is merged
231+
{
232+
from: 'ngAfterViewInit() {',
233+
to:
234+
'ngAfterViewInit() {\n' +
235+
'\t this.writeValue(this.value());'
236+
}
237+
],
230238
react: [
231239
// React not allowing selected for options
232240
{ from: 'selected={option.selected}', to: '' },

0 commit comments

Comments
 (0)