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 17, 2025
1 parent 2e605ab commit a9ea2ae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 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,13 @@ JSDialog.OpenDropdown = function (id, popupParent, entries, innerCallback, popup
]
};

if (!popupParent._onClose) {
popupParent._onClose = function () {
this.setAttribute('aria-expanded', false);
}.bind(popupParent);
}
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 +165,11 @@ JSDialog.OpenDropdown = function (id, popupParent, entries, innerCallback, popup
};

JSDialog.CloseDropdown = function (id) {
var popupParent = L.DomUtil.get(id.replace('-dropdown', ''));
if (popupParent && popupParent._onClose) {
popupParent._onClose();
}

L.Map.THIS.fire('jsdialog', {data: {
id: _createDropdownId(id),
jsontype: 'dialog',
Expand Down

0 comments on commit a9ea2ae

Please sign in to comment.