Skip to content

Fix #1303: Remove placeholder from TextField in v0.9 Angular and add to v0.10 spec#1372

Draft
josemontespg wants to merge 7 commits intogoogle:mainfrom
josemontespg:fix-1303-textfield-placeholder
Draft

Fix #1303: Remove placeholder from TextField in v0.9 Angular and add to v0.10 spec#1372
josemontespg wants to merge 7 commits intogoogle:mainfrom
josemontespg:fix-1303-textfield-placeholder

Conversation

@josemontespg
Copy link
Copy Markdown
Collaborator

@josemontespg josemontespg commented May 8, 2026

What

Removed support for the placeholder property in the v0.9 Angular implementation of the TextField component, and added it to the v0.10 specification.

Why

The placeholder property 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 for TextField, it was decided to add it to the upcoming v0.10 specification.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 51 to 53
(input)="handleInput($event)"
[placeholder]="placeholder()"

[class.invalid]="props()['isValid']?.value() === false"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
(input)="handleInput($event)"
[placeholder]="placeholder()"
[class.invalid]="props()['isValid']?.value() === false"
(input)="handleInput($event)"
[class.invalid]="props()['isValid']?.value() === false"

Comment on lines 100 to 102
readonly value = computed(() => this.props()['value']?.value() || '');
readonly placeholder = computed(
() => (this.props() as AnyDuringSchemaAlignment)['placeholder']?.value() || '',
);

readonly variant = computed(() => this.props()['variant']?.value());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant