-
Notifications
You must be signed in to change notification settings - Fork 4
Handling Toast actions (buttons and links) #11
Copy link
Copy link
Closed
Description
When the developer is creating a toast in HTML using , they can include in the children button(s) that will take some action upon user feedback. At this point, the intention is to have an actionclick event that would fire when a with a single button or link has had that button or link clicked.
I see two issues with including this as our action support:
- It doesn't address a case where the developer wants to put two action buttons in the toast.
- It doesn't address how to add actions using the
showToast()function.
A proposal that came up in #9 to solve this second issue was to allow the developer to pass in an action like so:
const toast = showToast("message", {
action: ['Click me', doSomething]
});This same pattern could also be used to pass in a list of actions, but would have the same issue with actionclick. This pattern would also need to be amended to support both buttons and links.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels