1
0
Fork 0

Maintain focus for inner-elements in a11y component

This commit is contained in:
Ava Wroten 2020-03-04 09:05:09 -06:00
parent 1d4d17eb94
commit acebd434c1
2 changed files with 4 additions and 2 deletions

View file

@ -10,7 +10,9 @@ export default class SortableGroupAccessibleComponent extends Component {
handleFocus() { this.groupHasFocus = true; }
@action
handleBlur() { this.groupHasFocus = false; }
handleBlur({ target, relatedTarget }) {
if (!target.contains(relatedTarget)) this.groupHasFocus = false;
}
@action
handleArrowUp() {

View file

@ -1,6 +1,6 @@
<div
class='relative border border-gray-400
{{if (and @groupHasFocus (eq @currentIndex @selectedIndex)) 'border-orange-400'}}'>
{{if (and @groupHasFocus (eq @currentIndex @selectedIndex)) 'border-orange-400'}}'>
{{#if (and @groupHasFocus (eq @currentIndex @selectedIndex))}}
<button
role="button"