Make ST-style buttons keyboard selectable

- Make ST-style buttons keyboard selectable
- Allow custom classes/selectors to be set as buttons too, with the same functionality (CSS selector-based)
- Observer to automatically add functionality to any button added to the DOM
- Allow buttons to not be selectable via 'disabled' or 'not_focusable'
This commit is contained in:
Wolfsblvt
2024-06-03 02:52:54 +02:00
parent 9318f94f08
commit 5cc4242c6f
4 changed files with 172 additions and 2 deletions

View File

@ -189,8 +189,8 @@ export class Popup {
break;
}
case 'Enter': {
// Only count enter if no modifier key is pressed
if (evt.altKey || evt.ctrlKey || evt.shiftKey)
// CTRL+Enter counts as a closing action, but all other modifiers (ALT, SHIFT) should not trigger this
if (evt.altKey || evt.shiftKey)
return;
// Check if we are the currently active popup