react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

feat: Add isFocusable to ToastOptions

Open JulianSelman opened this issue 10 months ago • 0 comments

Context

Currently, toasts will always be focusable, as they unconditionally set tabIndex to 0. If toasts have focusable elements inside them, it can be desirable to set the toast itself as unfocusable and enable focus on the contained elements (buttons, links, etc.) as well as the close box.

Changes

This change adds an optional boolean property to ToastOptions, isFocusable. If it is set to true (or is missing) then the toast will be focusable, as per existing behavior. If set to false then the toast will not be focusable.

JulianSelman avatar Apr 21 '25 01:04 JulianSelman