sonner
sonner copied to clipboard
Setting props on list item
Describe the feature / bug 📝:
Hi, I'm trying to set the tabIndex value of the parent container to -1 of a toast item. As you see in the image below it is currently not at -1 and I cannot see how I can change this.
I believe the tab indexing is targeting the li element. Is there currently a way to set the props on a list item as this would fix the issue? I checked the API documentation and I don't see that it is possible.
It would be cool of it was done via something like this:
toast(<div>A custom toast with default styling</div>, {
duration: 5000,
props: {
tabIndex: -1,
},
});
This would only spread the props onto the list item and not affect any other toasts.
Steps to reproduce the bug 🔁:
- Create a custom toast via the custom code: https://sonner.emilkowal.ski/toast#custom
- Make the toast appear.
- Press tab, it will select the toast.