-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Focus issue on Tearsheet with carbon Modal #2046
Comments
Hi @nelsonchen90, This might be an issue due to React portal. I have attempted to obtain the focus on an input inside the modal by adding |
@jagathgj |
Hi @nelsonchen90, I have investigated the issue. It might be a problem with the functionalities in Tearsheet. Tearsheet is claiming the focus back due to function written for 'stacked' tearsheet. If we move Modal inside the tearsheet, it will work as expected. But again this focus trap issue needs to be taken care. I will let you know once fixing it. |
Hi @nelsonchen90, It was found out that the Carbon 10 Modal doesn't support stacked Modals. Even though the Tearsheet is based on basic Modal component, the functions written for Tearsheetshell won't work on Modals and it would be hard to achieve the expected result. This issue should be taken care in Carbon 11. @elycheea FYI |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Closing this issue. #2452 is where we are tracking the nested modal/tearsheet issues further. @davidmenendez has opened PR and discussion in the Carbon repo as well. |
What package(s) are you using?
Detailed description
We need to open a modal on top of a tearsheet when user tries to close the tearsheet with form filled.
I am using React.portal to render both Tearsheet and Modal at the
document.body
.When the Modal is open, user is seeing issue with the focus still being on the tearsheet.
And in Chrome, the focus can not be fixed unless user click away from the current html document (i.e click the address bar in the browser) and comes back to the modal - all steps documented in this codesandbox example:
https://codesandbox.io/s/still-smoke-h1900i?file=/src/App.js
Tearsheet
The focus should be working properly on the Modal
Chrome, Firefox
Issue is found on Production running
@carbon/[email protected]
.But I can reproduce on
@carbon/[email protected]
with[email protected]
and[email protected]
Watson knowledge catalog. CPD 4.6 (Nov 2022)
Steps to reproduce the issue
Documented in the codesandbox
https://codesandbox.io/s/still-smoke-h1900i?file=/src/App.js
The text was updated successfully, but these errors were encountered: