Skip to content

Commit

Permalink
browser: accessibility: fix on close dropdown combobox
Browse files Browse the repository at this point in the history
.
Change-Id: I5a459164174ac4ba4cab42822772e3fb4a3dd711
Signed-off-by: Henry Castro <hcastro@collabora.com>
  • Loading branch information
hcvcastro committed Feb 6, 2025
1 parent 625d4eb commit 5d7913f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions browser/src/control/jsdialog/Util.Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ JSDialog.OpenDropdown = function (id, popupParent, entries, innerCallback, popup
]
};

this.popupParent = popupParent;
this.popupParent.setAttribute('aria-expanded', true);

var isChecked = function (unoCommand) {
var items = L.Map.THIS['stateChangeHandler'];
var val = items.getItemValue(unoCommand);
Expand Down Expand Up @@ -158,6 +161,11 @@ JSDialog.OpenDropdown = function (id, popupParent, entries, innerCallback, popup
};

JSDialog.CloseDropdown = function (id) {
if (this.popupParent) {
this.popupParent.setAttribute('aria-expanded', false);
this.popupParent = null;
}

L.Map.THIS.fire('jsdialog', {data: {
id: _createDropdownId(id),
jsontype: 'dialog',
Expand Down
4 changes: 3 additions & 1 deletion browser/src/docstate.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,7 @@ if (activateValidation) {
window.app.file = new Proxy(window.app.file, validator);
}

window.JSDialog = {}; // initialize jsdialog module
window.JSDialog = {
popupParent : null,
}; // initialize jsdialog module
window.SlideShow = {}; // initialize slideshow module

0 comments on commit 5d7913f

Please sign in to comment.