Skip to content

Commit

Permalink
gjort en fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aljlo2 committed Nov 12, 2024
1 parent 1b6b826 commit 7585905
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="filter-tag-group" (keydown)="onKeydown($event)">
<div class="filter-tag-group">
<ng-content></ng-content>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,11 @@ export class FilterTagGroupComponent implements AfterContentInit, OnDestroy {
this.ngUnsubscribe.complete();
}

onKeydown(event: any) {
if (event.key === 'Tab') {
const filterTagGroup = event.target.closest('vgr-filter-tag-group');
event.preventDefault();
var nextEl = this.findNextTabStop(document.activeElement);
nextEl.focus();
}
}

findNextTabStop(el) {
var universe = document.querySelectorAll('[tabindex]');
var list = Array.prototype.filter.call(universe, function(item) {return item.tabIndex >= "0"});
console.log(list)
var index = list.indexOf(el);
return list[index + 1] || list[0];
}

setFilterTagTabFocusability() {
this.filterTags.forEach((x) => {
x.makeTabFocusable(false);
});
this.filterTags.get(0).makeTabFocusable(true);
// this.filterTags.forEach((x) => {
// x.makeTabFocusable(true);
// });
}

setFilterTagFocus() {
Expand Down

0 comments on commit 7585905

Please sign in to comment.