Skip to content

Commit

Permalink
Revert "Filter-tag: Handle focus in IE (#475)"
Browse files Browse the repository at this point in the history
This reverts commit aa52124.
  • Loading branch information
AronssonFredrik authored and synne1 committed Dec 17, 2020
1 parent 961d5af commit bcdef86
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class FilterTagGroupComponent implements AfterContentInit, OnDestroy {
if (this.lastSelectedIndex < nonRemovedFilterTags.length) {
nonRemovedFilterTags[this.lastSelectedIndex].focus();
} else if (nonRemovedFilterTags.length) {
this.lastSelectedIndex = nonRemovedFilterTags.length - 1;
nonRemovedFilterTags[nonRemovedFilterTags.length - 1].focus();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,7 @@ export class FilterTagComponent implements AfterViewInit {
}

focus() {
// focus() does not work in IE11 unless
// called after a short delay. Wrap in if
// to not do this in better browsers.
const re = /Trident\/7/;
const isIE11 = re.test(window.navigator.userAgent);

if (isIE11) {
setTimeout(() => {
this.filtertag.nativeElement.focus();
}, 5);
} else {
this.filtertag.nativeElement.focus();
}
this.filtertag.nativeElement.focus();
}

emitRemove() {
Expand Down

0 comments on commit bcdef86

Please sign in to comment.