admin管理员组

文章数量:1125933

When the Material UI Backdrop component is in use, the elements in the website are still visible and accessible, which can be fairly easy to see in the official demo, or by using this CodeSandbox:

I went through certain questions in plain JS, such as tabindex -1 not working for child elements, and many suggested using visibility: hidden. However, I would like to know if there are ways to prevent other components from accessing, but still being visible.

When the Material UI Backdrop component is in use, the elements in the website are still visible and accessible, which can be fairly easy to see in the official demo, or by using this CodeSandbox:

I went through certain questions in plain JS, such as tabindex -1 not working for child elements, and many suggested using visibility: hidden. However, I would like to know if there are ways to prevent other components from accessing, but still being visible.

Share Improve this question asked Jan 9 at 4:50 hokwanhunghokwanhung 6051 gold badge8 silver badges24 bronze badges 4
  • are the buttons clickable tho when backdrop open stackblitz.com/edit/react-n5jldtnj?file=Demo.tsx (check console logs). is the problem the background is visible. or the backdrop disappears when clicked out – cmgchess Commented Jan 9 at 6:01
  • @cmgchess With the link you provided, the backdrop does not disappear, but the buttons are still clickable (the console will log via each click) - which is what I want to prevent from happening. – hokwanhung Commented Jan 9 at 6:17
  • hmm for me the backdrop disappears and button onclick will not trigger when background open – cmgchess Commented Jan 9 at 6:19
  • @cmgchess Hmm, that is weird. I was using the link you provided, too. Would it be related to the browser settings? I am using Microsoft Edge right now. – hokwanhung Commented 2 days ago
Add a comment  | 

1 Answer 1

Reset to default 0

You can try using pointer-events: none; style.

本文标签: