Skip to content

Commit 422f105

Browse files
Elliott Marquezcopybara-github
authored andcommitted
docs(textfield): add jsdoc several properties
Added jsdoc to properties on textfield itself. I don't think we can count the bug closed until the api docs bot is fixed so that we can see what is exposed or not via the new mixins. PiperOrigin-RevId: 592071151
1 parent edb3559 commit 422f105

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

textfield/internal/text-field.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,26 @@ export abstract class TextField extends textFieldBaseClass {
120120
*/
121121
@property({attribute: 'error-text'}) errorText = '';
122122

123+
/**
124+
* The floating Material label of the textfield component. It informs the user
125+
* about what information is requested for a text field. It is aligned with
126+
* the input text, is always visible, and it floats when focused or when text
127+
* is entered into the textfield. This label also sets accessibilty labels,
128+
* but the accessible label is overriden by `aria-label`.
129+
*
130+
* Learn more about floating labels from the Material Design guidelines:
131+
* https://m3.material.io/components/text-fields/guidelines
132+
*/
123133
@property() label = '';
124134

135+
/**
136+
* Indicates that the user must specify a value for the input before the
137+
* owning form can be submitted and will render an error state when
138+
* `reportValidity()` is invoked when value is empty. Additionally the
139+
* floating label will render an asterisk `"*"` when true.
140+
*
141+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/required
142+
*/
125143
@property({type: Boolean, reflect: true}) required = false;
126144

127145
/**
@@ -216,6 +234,14 @@ export abstract class TextField extends textFieldBaseClass {
216234
*/
217235
@property() pattern = '';
218236

237+
/**
238+
* Defines the text displayed in the textfield when it has no value. Provides
239+
* a brief hint to the user as to the expected type of data that should be
240+
* entered into the control. Unlike `label`, the placeholder is not visible
241+
* and does not float when the textfield has a value.
242+
*
243+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/placeholder
244+
*/
219245
@property({reflect: true, converter: stringConverter}) placeholder = '';
220246

221247
/**

0 commit comments

Comments
 (0)