bug: toast, cannot render only button and have container fit width
See original GitHub issuePrerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
i really like the Toast Component, but in 99% of my apps i ending up implementing my own toast’s, which has mostly two reasons:
- Swipeable feature (there exists a PR for that since a long time: #23124)
- Click handler on the toast itself - not a specific button
The second one is the one i want to target in here 😊
Describe the Use Case
It would be great beeing able to add a click handler to the whole toast. Two things i would use this for:
- “Undo” toast after an action
- In most apps i fetch push notifications when you are in app and present them via a toast - like instagram does.
For both cases the click handler would help a lot, as an extra button is not very nice here.
Describe Preferred Solution
This should work similar to the handler of e.g. an alert button: Called on click and you can return a boolean | Promise<boolean>
that says if you should dismiss or don’t dismiss the toast
Describe Alternatives
No response
Related Code
No response
Additional Information
No response
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
html - React-Bootstrap Rows/Columns are not the full width of ...
All I am trying to do (in my React project) is position 2 elements on the screen side by side, the element on...
Read more >Ext.layout.container.Fit | Ext JS 6.2.0 - Sencha Documentation
This is a base class for layouts that contain a single item that automatically expands to fill the layout's container. This class is...
Read more >Toast | Components - BootstrapVue
Toasts have a semi-transparent background by default. To disable the default transparency, just set the solid prop to true to remove the alpha...
Read more >Button | Android Developers
However these software-rendered usages are discouraged and have compatibility issues with hardware-only rendering features such as Config.
Read more >JavaScript Data Grid Configuration - DevExtreme - DevExpress
When this property is set to true, all columns adjust their width to the content. ... DevExtreme HTML5 JavaScript DataGrid Export Button.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The wrapper element itself is not a button, so it should not be clickable. It would definitely be easier, but having the container (with headers/messages) be clickable is not really how toast was intended to be used.
Wouldn’t it be easier then to just add a click handler? 🤔 This would also give the advantage that it would work with header and message for example