yjose / reactjs-popup

React Popup Component - Modals,Tooltips and Menus —  All in one
https://react-popup.elazizi.com/
MIT License
1.8k stars 207 forks source link

Accessibility bug: everything is a tooltip except modal dialogs #334

Open adamnovak opened 1 year ago

adamnovak commented 1 year ago

Aria tooltips are only allowed to be used for actual tooltips. It would be a bug to use that role for anything other than contextual help, such as a context menu or a popup with controls in it.

But here the role of popups is hardcoded to be either "dialog" for modal dialogs, or "tooltip" for anything that isn't a modal dialog: https://github.com/yjose/reactjs-popup/blob/4d8e41a5995ba5074c0133bf0901bf0f93805616/src/index.tsx#L280

This makes the library not work for non-modal dialogs, or for menus, because they would have the incorrect tooltip role.