Fix #1303: Remove placeholder from TextField in v0.9 Angular and add to v0.10 spec#1372
Fix #1303: Remove placeholder from TextField in v0.9 Angular and add to v0.10 spec#1372josemontespg wants to merge 7 commits intogoogle:mainfrom
Conversation
…d add to v0.10 spec
There was a problem hiding this comment.
Code Review
This pull request removes the placeholder binding and its corresponding computed property from the Angular TextFieldComponent in version 0.9, while adding the placeholder property to the version 0.10 JSON specification. The review feedback recommends removing the resulting blank lines in both the component template and the class definition to maintain code cleanliness and consistency.
| (input)="handleInput($event)" | ||
| [placeholder]="placeholder()" | ||
|
|
||
| [class.invalid]="props()['isValid']?.value() === false" |
There was a problem hiding this comment.
The removal of the [placeholder] binding leaves an unnecessary blank line within the <input> tag. It is better to remove this line to maintain clean template syntax.
| (input)="handleInput($event)" | |
| [placeholder]="placeholder()" | |
| [class.invalid]="props()['isValid']?.value() === false" | |
| (input)="handleInput($event)" | |
| [class.invalid]="props()['isValid']?.value() === false" |
| readonly value = computed(() => this.props()['value']?.value() || ''); | ||
| readonly placeholder = computed( | ||
| () => (this.props() as AnyDuringSchemaAlignment)['placeholder']?.value() || '', | ||
| ); | ||
|
|
||
| readonly variant = computed(() => this.props()['variant']?.value()); |
There was a problem hiding this comment.
The removal of the placeholder computed property leaves an unnecessary blank line. Since other property declarations in this class (like label and value) are not separated by newlines, this should be removed for consistency.
| readonly value = computed(() => this.props()['value']?.value() || ''); | |
| readonly placeholder = computed( | |
| () => (this.props() as AnyDuringSchemaAlignment)['placeholder']?.value() || '', | |
| ); | |
| readonly variant = computed(() => this.props()['variant']?.value()); | |
| readonly value = computed(() => this.props()['value']?.value() || ''); | |
| readonly variant = computed(() => this.props()['variant']?.value()); |
What
Removed support for the
placeholderproperty in the v0.9 Angular implementation of theTextFieldcomponent, and added it to the v0.10 specification.Why
The
placeholderproperty was supported in the Angular renderer but was missing from the v0.9 spec. To achieve consistency for v0.9, it was removed from the renderer. However, since it maps directly to an HTML attribute and is essential forTextField, it was decided to add it to the upcoming v0.10 specification.