Skip to content

Commit

Permalink
Fix tab navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zefling committed Aug 29, 2023
1 parent a4767af commit 8500fbc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions projects/ng-select2-component/src/lib/select2.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,11 +688,9 @@ export class Select2 implements ControlValueAccessor, OnInit, DoCheck, AfterView
} else if (this._testKey(event, ['ArrowDown', 'ArrowUp', 'Enter', 40, 38, 13])) {
this.toggleOpenAndClose(true, true, event);
event.preventDefault();
} else if (this._testKey(event, ['Escape', 'Tab', 9, 27])) {
} else if (this._testKey(event, ['Escape', 'Tab', 9, 27]) && this.isOpen) {
this.toggleOpenAndClose(false);
if (this.isOpen) {
event.preventDefault();
}
event.preventDefault();
this._onTouched();
}
}
Expand Down

0 comments on commit 8500fbc

Please sign in to comment.