You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When activating a button or a link inside the drawer using a keyboard, the drawer closes prematurely and the focused item does not get activated.
This is caused by the fact that the onShadowClicked handler is set to handle the click event, which also fires for keyboard-activated links and buttons.
onShadowClicked uses the event's mouse coordinates to determine whether the click happened outside the dialog, Since key events have clientX and clientY set to 0, the handler assumes the click was outside the drawer and closes it.
Easiest solution would be to instead listen for mousedown instead, or otherwise check first that the event is not a key event (e.g. by returning when clientX and ClientY are 0)
To reproduce:
Set up a course with adapt-contrib-resources. With the drawer open, tab to a filter button or resource item, and press Enter
The text was updated successfully, but these errors were encountered:
When activating a button or a link inside the drawer using a keyboard, the drawer closes prematurely and the focused item does not get activated.
This is caused by the fact that the
onShadowClicked
handler is set to handle theclick
event, which also fires for keyboard-activated links and buttons.adapt-contrib-core/js/views/drawerView.js
Line 83 in 2f7f5a7
onShadowClicked
uses the event's mouse coordinates to determine whether the click happened outside the dialog, Since key events haveclientX
andclientY
set to0
, the handler assumes the click was outside the drawer and closes it.Easiest solution would be to instead listen for
mousedown
instead, or otherwise check first that the event is not a key event (e.g. by returning when clientX and ClientY are 0)To reproduce:
Set up a course with adapt-contrib-resources. With the drawer open, tab to a filter button or resource item, and press Enter
The text was updated successfully, but these errors were encountered: