You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an ActionableNotification is present on the page when opening a Modal this will cause the side-effect of auto-focusing on the action button or the exit button from the ActionableNotification causing an undesired scroll to the page.
If you exit the modal by clicking outside, it will scroll back up and autofocus the button that triggered it to be opened.
If you exit the modal by clicking the "X" button, it will not scroll to the original position and will keep the focus on the action button or the exit button, and if you try to click the button that triggers the modal it will just scroll to the ActionableNotification since the focus is still on that element.
This can be fixed by adding the hasFocus prop set to false to the ActionableNotification, however, this should not be the default behavior.
I'm still not sure what is causing this side-effect, therefor I still have concerns that this may be happening to other components.
Package
@carbon/react
Browser
Chrome
Package version
1.55.0
React version
18.2.0
Description
When an ActionableNotification is present on the page when opening a Modal this will cause the side-effect of auto-focusing on the action button or the exit button from the ActionableNotification causing an undesired scroll to the page.
If you exit the modal by clicking outside, it will scroll back up and autofocus the button that triggered it to be opened.
If you exit the modal by clicking the "X" button, it will not scroll to the original position and will keep the focus on the action button or the exit button, and if you try to click the button that triggers the modal it will just scroll to the ActionableNotification since the focus is still on that element.
This can be fixed by adding the
hasFocus
prop set to false to the ActionableNotification, however, this should not be the default behavior.I'm still not sure what is causing this side-effect, therefor I still have concerns that this may be happening to other components.
Demo:
Reproduction/example
https://codesandbox.io/p/devbox/carbon-modal-actionable-notification-s8z4gz?file=%2Fsrc%2FExample%2FExample.jsx
Steps to reproduce
Reproduce the scrolling/autofocus behavior
To reproduce the issue of the focus remaining in the actionable notification:
Suggested Severity
None
Application/PAL
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: