You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2025. It is now read-only.
chore(text-field): Split out input into subelement (#1631)
BREAKING CHANGE: Please update implementations of MDCTextFieldAdapter to implement getInputFoundation(). Methods registerInputInteractionHandler()/deregisterInputInteractionHandler() have been renamed to registerInputEventHandler()/deregisterInputEventHandler(). getNativeInput() is no longer in MDCTextFieldAdapter. See the README for mdc-textfield/input for more information.
Copy file name to clipboardExpand all lines: packages/mdc-textfield/README.md
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -323,21 +323,21 @@ complicated.
323
323
324
324
| Method Signature | Description |
325
325
| --- | --- |
326
-
| addClass(className: string) => void | Adds a class to the root element |
327
-
| removeClass(className: string) => void | Removes a class from the root element |
328
-
| addClassToLabel(className: string) => void | Adds a class to the label element. We recommend you add a conditional check here, and in `removeClassFromLabel` for whether or not the label is present so that the JS component could be used with text fields that don't require a label, such as the full-width text field. |
329
-
| removeClassFromLabel(className: string) => void | Removes a class from the label element |
330
-
| eventTargetHasClass(target: HTMLElement, className: string) => boolean | Returns true if classname exists for a given target element |
331
-
| registerTextFieldInteractionHandler(evtType: string, handler: EventListener) => void | Registers an event handler on the root element for a given event |
332
-
| deregisterTextFieldInteractionHandler(evtType: string, handler: EventListener) => void | Deregisters an event handler on the root element for a given event |
333
-
| notifyIconAction() => void | Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon |
334
-
|registerInputInteractionHandler(evtType: string, handler: EventListener) => void | Registers an event listener on the native input element for a given event |
335
-
|deregisterInputInteractionHandler(evtType: string, handler: EventListener) => void | Deregisters an event listener on the native input element for a given event |
336
-
| registerBottomLineEventHandler(evtType: string, handler: EventListener) => void | Registers an event listener on the bottom line element for a given event |
337
-
| deregisterBottomLineEventHandler(evtType: string, handler: EventListener) => void | Deregisters an event listener on the bottom line element for a given event |
338
-
|getNativeInput() => {value: string, disabled: boolean, badInput: boolean, checkValidity: () => boolean}? | Returns an object representing the native text input element, with a similar API shape. The object returned should include the `value`, `disabled` and `badInput` properties, as well as the `checkValidity()` function. We _never_ alter the value within our code, however we _do_ update the disabled property, so if you choose to duck-type the return value for this method in your implementation it's important to keep this in mind. Also note that this method can return null, which the foundation will handle gracefully.|
339
-
|getBottomLineFoundation() => MDCTextFieldBottomLineFoundation| Returns the instance of the bottom line element's foundation |
340
-
|getHelperTextFoundation() => MDCTextFieldHelperTextFoundation| Returns the instance of the helper text element's foundation |
326
+
|`addClass(className: string) => void`| Adds a class to the root element |
327
+
|`removeClass(className: string) => void`| Removes a class from the root element |
328
+
|`addClassToLabel(className: string) => void`| Adds a class to the label element. We recommend you add a conditional check here, and in `removeClassFromLabel` for whether or not the label is present so that the JS component could be used with text fields that don't require a label, such as the full-width text field. |
329
+
|`removeClassFromLabel(className: string) => void`| Removes a class from the label element |
330
+
|`eventTargetHasClass(target: HTMLElement, className: string) => boolean`| Returns true if classname exists for a given target element |
331
+
|`registerTextFieldInteractionHandler(evtType: string, handler: EventListener) => void`| Registers an event handler on the root element for a given event |
332
+
|`deregisterTextFieldInteractionHandler(evtType: string, handler: EventListener) => void`| Deregisters an event handler on the root element for a given event |
333
+
|`notifyIconAction() => void`| Emits a custom event "MDCTextField:icon" denoting a user has clicked the icon |
334
+
|`registerInputEventHandler(evtType: string, handler: EventListener) => void`| Registers an event listener on the input element for a given event |
335
+
|`deregisterInputEventHandler(evtType: string, handler: EventListener) => void`| Deregisters an event listener on the input element for a given event |
336
+
|`registerBottomLineEventHandler(evtType: string, handler: EventListener) => void`| Registers an event listener on the bottom line element for a given event |
337
+
|`deregisterBottomLineEventHandler(evtType: string, handler: EventListener) => void`| Deregisters an event listener on the bottom line element for a given event |
338
+
|`getBottomLineFoundation() => MDCTextFieldBottomLineFoundation`| Returns the instance of the bottom line element's foundation |
339
+
|`getHelperTextFoundation() => MDCTextFieldHelperTextFoundation`| Returns the instance of the helper text element's foundation |
340
+
|`getInputFoundation() => MDCTextFieldInputFoundation`| Returns the instance of the input element's foundation |
0 commit comments