This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-4d615df8-c19e-4e65-a18d-6ca946642a82 XWIKI-25653 Open

Provide a reusable keyboard handler for the non-button elements that have the button role

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-9873e8e5-8b18-4727-bec4-f4a7ea6ace01 Charpentier Lucas created this issue on 04/Nov/26 14:47
 
Summary: Provide a reusable keyboard handler for the non-button elements that have the button role
Issue Type: cid:jira-generated-image-avatar-4d615df8-c19e-4e65-a18d-6ca946642a82 Improvement
Affects Versions: 17.10.14
Assignee: Unassigned
Components: Web - Templates & Resources
Created: 04/Nov/26 14:47
Priority: cid:jira-generated-image-static-major-4b7f2dd0-82f1-4258-b71a-0b4f785cdf52 Major
Reporter: Charpentier Lucas
Description:

Some elements that are not buttons get the button role, because their markup can't be a real button element: for instance the rendering errors, whose markup is generated by xwiki-rendering, the panel resize handle in leftpanels.vm, or the a elements with the button role in drawer_macros.vm. A real button is activated with both the Enter and Space keys, but these elements only react to the keys that their own element supports: a div reacts to none of them, and a link only reacts to Enter. Keyboard users then can't activate them the way they activate any other button.

Each of them currently needs its own keydown listener to fix this, like the one added for the rendering errors in XWIKI-23602. XWiki should provide a reusable handler instead, that the elements with the button role can use to be activated with Enter and Space like a real button.

This was discussed in https://github.com/xwiki/xwiki-platform/pull/4670#discussion_r4452298174.