theKashey / react-focus-lock

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

Preact 10.11.2 is now rendering with data-focus-lock-disabled="false" #227

Closed corinnaSchultz closed 1 year ago

corinnaSchultz commented 1 year ago

I'm not sure if this is a bug (and if there is, if it's in focus-lock, or if it's in Preact), or if this is just a difference with no consequence; I was unable to figure out whether there were unexpected side effects.

Can someone advise whether this difference is something to worry about? Can I safely upgrade to Preact 10.11.2?

Compared with Preact 10.11.0, here is the rendering difference when I create the FocusLock with no "disabled" option: there is now an attribute data-focus-lock-disabled="false" where previously there was no attribute.

Difference: ``` - '
content
' + '
content
' ``` I'm using FocusLock like this: ``` {children} ``` noFocusGuards is either an empty string or "tail" (both ways show the issue). The overlayRef is used in a useEffect to add aria-hidden to the rest of the page. I don't think it's relevant to this issue.
theKashey commented 1 year ago

Worry not. The "false" value has no effect and this properly always should have been there. I really wonder why it was not there before - https://github.com/theKashey/react-focus-lock/blob/b786821040d2231ed7f1b03273fa0e2902a7e22f/src/Lock.js#L127