theKashey / react-focus-lock

It is a trap! A lock for a Focus. 🔓
MIT License
1.27k stars 67 forks source link

preventScroll is affecting scroll inside a modal #244

Closed Yamini-Hrishikesh closed 1 year ago

Yamini-Hrishikesh commented 1 year ago

Version: 2.8.1

Issue Description:

I have popup dialog in which I am having several sections of scrollable area ( not a great design, I know). The entire dialog is also scrollable and we had given <FocusLock focusOptions={{ preventScroll: true }}> to prevent it from jumping to the top if the user clicked outside the dialog area.

However, preventScroll is affecting the scrolls inside the main dialog div. Is there any way to prevent the option from affecting the scroll in the inner div contents and apply it only for the outer div?