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.
MDC Snackbar ships with a Component / Foundation combo which provides the API for showing snackbar
@@ -125,6 +142,38 @@ properties and their usage.
125
142
| multiline | Whether to show the snackbar with space for multiple lines of text | Optional | Boolean |
126
143
| actionOnBottom | Whether to show the action below the multiple lines of text | Optional, applies when multiline is true | Boolean |
127
144
145
+
### Responding to a Snackbar Action
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.
|`registerBlurHandler(handler: EventListener) => void`| Registers an event handler to be called when a `blur` event is triggered on the action button |
208
+
|`deregisterBlurHandler(handler: EventListener) => void`| Deregisters a `blur` event handler from the actionButton |
209
+
|`registerVisibilityChangeHandler(handler: EventListener) => void`| Registers an event handler to be called when a 'visibilitychange' event occurs |
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`|
212
+
|`deregisterCapturedInteractionHandler(evtType: string, handler: EventListener) => void`| Deregisters an event handler from the `body`|
156
213
|`registerActionClickHandler(handler: EventListener) => void`| Registers an event handler to be called when a `click` event is triggered on the action element. |
157
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. |
158
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