Create an attribute and property for toast closebutton and attach close functionality #17869
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change sets the groundwork for the toast closebutton, by
adding an attribute to set the closebutton content,
creating a closeButton property to reflect that attribute,
and adding an event listener to close the toast when the closebutton is pressed.
This change implements the close button API described in
(https://github.com/jackbsteinberg/std-toast/blob/eec7728f7082a897d777181ac07b0448062ffca5/README.md),
and is the subject of debate on issue #48 on the explainer here
jackbsteinberg/std-toast#48.
Future CLs will add the closeButton option for showToast
(https://github.com/jackbsteinberg/std-toast/tree/master#showtoastmessage-options)
Link: https://chromium-review.googlesource.com/c/chromium/src/+/1706453
Bug: 972945
Change-Id: I5d6c3055791a9f93ef414e575e128c61e2a944ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1699269
Reviewed-by: Fergal Daly <fergal@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Jack Steinberg <jacksteinberg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678530}