Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set 'aria-expanded' to dropdwon combobox #11056

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

hcvcastro
Copy link
Member

  • browser: accessibility: set 'aria-expanded' to dropdown button
  • browser: accessibility: set 'aria-expanded' to widget menu button
  • browser: accessibility: fix close dropdown widget menu button
  • browser: accessibility: fix no click, close dropdown button
  • browser: accessibility: set 'aria-popup' to combobox
  • browser: accessibility: set 'aria-expanded' to combobox
  • browser: accessibility: fix no click, close dropdown combobox

@hcvcastro hcvcastro force-pushed the pr/master/9F branch 2 times, most recently from 189dfcd to 836aa22 Compare January 31, 2025 11:32
JSDialog.AddOnClick(control.arrow, clickFunction);
builder.map.on('jsdialog', function (e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is duplicated, also best to not put many places for processing the message queue as it might later cause hard to find bugs.

It goes: socket -> JSDialogMessageRouter -> JSDialog component and only the "component" should execute any operations, calling some widget actions if needed.

Possible solution:

  • please put in the widget's root (control.container) function: onDropdownClose
  • Dropdown widget has already information about widget from which it was created (see JSDialog.OpenDropdown(dropdownId, control.container <---)
  • Dropdown when closing, can call the onDropdownClose if exists

https://github.com/CollaboraOnline/online/blob/836aa22dad3d1d64668e213e9749f71b3ffedc14/browser/src/control/jsdialog/Util.Dropdown.js

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting your suggestion, I have traced events when dropdown is closed, which exists JSDialog.CloseDropdown and 'clickfunction' callbacks, I did not want to do invasive changes. Well let's try it.

@@ -316,5 +320,13 @@ JSDialog.combobox = function (parentContainer, data, builder) {
content.value = text;
};

builder.map.on('jsdialog', function (e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is duplication I'm talking about

@@ -145,6 +145,7 @@ L.Control.JSDialog = L.Control.extend({
console.warn('closePopover: no builder');
}
else {
JSDialog.CloseDropdown(id, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it is needed, how does the call stack look like for this bug?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(anonymous) (Widget.Combobox.js:327)
fire (Events.js:146)
JSDialog.CloseDropdown (Util.Dropdown.js:161)
closePopover (Control.JSDialog.js:148)
close (Control.JSDialog.js:86)
(anonymous) (Control.JSDialog.js:227)

@hcvcastro hcvcastro force-pushed the pr/master/9F branch 7 times, most recently from 5d7913f to b233cf3 Compare February 6, 2025 18:05
@@ -145,6 +145,7 @@ L.Control.JSDialog = L.Control.extend({
console.warn('closePopover: no builder');
}
else {
JSDialog.CloseDropdown(id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it calls: L.Map.THIS.fire('jsdialog' which probably will land here again.
easy to do a cycle, does it work? do we have cypress test for closing popup using that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I do not have evidence failing unit test

@@ -154,5 +154,7 @@ if (activateValidation) {
window.app.file = new Proxy(window.app.file, validator);
}

window.JSDialog = {}; // initialize jsdialog module
window.JSDialog = {
popupParent : null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to avoid globals, just keep it in the instance

@@ -158,6 +161,11 @@ JSDialog.OpenDropdown = function (id, popupParent, entries, innerCallback, popup
};

JSDialog.CloseDropdown = function (id) {
if (this.popupParent) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid globals, we have menus with submenus :)
see calc -> conditional formatting

we need to save it inside instance

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cascade popups?. Let me see what can I do

@eszkadev eszkadev added the draft label Feb 12, 2025
@hcvcastro hcvcastro force-pushed the pr/master/9F branch 3 times, most recently from ea04f22 to a9ea2ae Compare February 17, 2025 10:46
Even I have setup the attributes, the function are unreachable
for desktop app.

Change-Id: Ib9e8fbc4027c1f64f78406d9ffa088c04c64709c
Signed-off-by: Henry Castro <hcastro@collabora.com>
If it is not clicked in the dropdown container there was
no way to set attribute 'aria-expanded' to false

Change-Id: I3a2f0db7b4516ed0a66b77326ab87c6a66339663
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I782477b61bb2ad5732bc101306bf7a9d4dda4eb4
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I45b4891a3b0bd52994cc264c46efe3241e150a7d
Signed-off-by: Henry Castro <hcastro@collabora.com>
.
Change-Id: I5a459164174ac4ba4cab42822772e3fb4a3dd711
Signed-off-by: Henry Castro <hcastro@collabora.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To Review
Development

Successfully merging this pull request may close these issues.

2 participants