Skip to content

Commit b88a5f6

Browse files
committed
fix: close dropdown on Tab key press to preserve focus order and accessibility compliance
Signed-off-by: Parth Raiyani <[email protected]> Change-Id: I4a3bad96f0e1f713d1eea8653fbaba240dda942a
1 parent ea313a2 commit b88a5f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

browser/src/control/jsdialog/Widget.Combobox.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ JSDialog.comboboxEntry = function (parentContainer, data, builder) {
8282
}
8383
});
8484

85+
entry.addEventListener('keydown', function (event) {
86+
if (event.key === 'Tab') {
87+
JSDialog.CloseDropdown(data.comboboxId);
88+
event.preventDefault();
89+
}
90+
});
91+
8592
if (data.hasSubMenu) {
8693
entry.setAttribute('aria-haspopup', true);
8794
entry.setAttribute('aria-expanded', false);

0 commit comments

Comments
 (0)