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.
Copy file name to clipboardExpand all lines: packages/mdc-snackbar/README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ properties and their usage.
144
144
145
145
### Responding to a Snackbar Action
146
146
147
-
To respond to a snackbar action, assign a function to the optional `actionHandler` property in the object that gets passed to the `show` method. If you choose to set this property, you *must _also_* set the `actionText` property.
147
+
To respond to a snackbar action, assign a function to the optional `actionHandler` property in the object that gets passed to the `show` method. If you choose to set this property, you *must _also_* set the `actionText` property, or the component will complain.
148
148
149
149
```html
150
150
<divclass="mdc-snackbar"
@@ -198,16 +198,18 @@ The adapter for snackbars must provide the following functions, with correct sig
198
198
|`removeClass(className: string) => void`| Removes a class from the root element. |
199
199
|`setAriaHidden() => void`| Sets `aria-hidden="true"` on the root element. |
200
200
|`unsetAriaHidden() => void`| Removes the `aria-hidden` attribute from the root element. |
201
-
|`setMessageText(message: string) => void`| Set the text content of the message element. |
202
-
|`setActionText(actionText: string) => void`| Set the text content of the action element. |
203
201
|`setActionAriaHidden() => void`| Sets `aria-hidden="true"` on the action element. |
204
202
|`unsetActionAriaHidden() => void`| Removes the `aria-hidden` attribute from the action element. |
205
-
|`registerFocusHandler(handler: EventListener) => void`| Registers an event handler to be called when a `focus` event is triggered on the `body`|
206
-
|`deregisterFocusHandler(handler: EventListener) => void`| Deregisters a `focus` event handler from the `body`|
207
-
|`registerBlurHandler(handler: EventListener) => void`| Registers an event handler to be called when a `blur` event is triggered on the action button |
203
+
|`setActionText(actionText: string) => void`| Sets the text content of the action element. |
204
+
|`setMessageText(message: string) => void`| Sets the text content of the message element. |
205
+
|`setFocus() => void`| Sets focus on the action button. |
|`registerBlurHandler(handler: EventListener) => void`| Registers an event handler to be called when a `blur` event is triggered on the action button. This happens during the capture phase of the event. |
208
208
|`deregisterBlurHandler(handler: EventListener) => void`| Deregisters a `blur` event handler from the actionButton |
209
209
|`registerVisibilityChangeHandler(handler: EventListener) => void`| Registers an event handler to be called when a 'visibilitychange' event occurs |
210
210
|`deregisterVisibilityChangeHandler(handler: EventListener) => void`| Deregisters an event handler to be called when a 'visibilitychange' event occurs |
211
+
|`registerCapturedInteractionHandler(evtType: string, handler: EventListener) => void`| Registers an event handler to be called when the given event type is triggered on the `body`. This happens during the capture phase of an event. |
212
+
|`deregisterCapturedInteractionHandler(evtType: string, handler: EventListener) => void`| Deregisters an event handler from the `body`|
211
213
|`registerActionClickHandler(handler: EventListener) => void`| Registers an event handler to be called when a `click` event is triggered on the action element. |
212
214
|`deregisterActionClickHandler(handler: EventListener) => void`| Deregisters an event handler from a `click` event on the action element. This will only be called with handlers that have previously been passed to `registerActionClickHandler` calls. |
213
215
|`registerTransitionEndHandler(handler: EventListener) => void`| Registers an event handler to be called when an `transitionend` event is triggered on the root element. Note that you must account for vendor prefixes in order for this to work correctly. |
0 commit comments