Skip to content

Commit 2f907c3

Browse files
authored
Refactor ngAfterViewInit to simplify value assignment
1 parent eb888b0 commit 2f907c3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,7 @@ export const getComponents = (): Component[] => [
221221
from: 'ngAfterViewInit() {',
222222
to:
223223
'ngAfterViewInit() {\n' +
224-
'\tif ((this.variant() === "floating" || !!this.placeholder()) && !this.value()) {\n' +
225-
'\t\tthis.writeValue(this.options()?.[0]?.value ?? "");\n' +
226-
'\t}\n'
224+
'\t this.writeValue(this.value() ?? "");'
227225
}
228226
],
229227
react: [

0 commit comments

Comments
 (0)