dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

Fix Focus Lock issue #1595

Closed GomezIvann closed 1 year ago

GomezIvann commented 1 year ago

Checklist

Description As described in the linked issue, an error was spotted at the Dialog when using Jest and having to render this component. After some research, this problem was related to a nwsapi problem, which is a library used by Jest jsdom.

So, to fix this, the aria-disabled selector was removed from the tabbable elements query at the FocusLock component. Apart from solving this problem, the change is motivated by the fact that aria-disabled is a semantic attribute, i.e. it has no functionality on the component. Therefore, excluding elements with this attribute from the list of tabbable elements of the focus lock is unnecessary.

Additional context Issue: https://github.com/dperini/nwsapi/issues/81

Closes #1586

aidamag commented 1 year ago

Also, I did npm install in the lib folder and I can see a new dependency added into the package-lock.json. I think it would be a good idea to update it.

image