A11y: move buttons into fields

This commit is contained in:
Pieter Vander Vennet 2023-12-26 22:30:27 +01:00
parent 30c9034e7b
commit 1b10f1f64d
23 changed files with 529 additions and 414 deletions

View file

@ -1638,13 +1638,22 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return newObj
}
public static focusOn(el: HTMLElement): void {
if (!el) {
return
}
requestAnimationFrame(() => {
el.focus()
})
}
/**
* Searches a child that can be focused on, by first selecting a 'focusable', then a button, then a link
*
* Returns the focussed element
* @param el
*/
public static focusOnFocusableChild(el: HTMLElement): undefined {
public static focusOnFocusableChild(el: HTMLElement): void {
if (!el) {
return
}