dropdown_button2 icon indicating copy to clipboard operation
dropdown_button2 copied to clipboard

No keyboard usage for accessibility

Open willsmanley opened this issue 1 year ago • 8 comments

On web builds, it is impossible to navigate the dropdown options using the arrow keys.

This is present in material's dropdown button, but not this implementation.

It should work the same as an HTML <select> where you can focus into the dropdown with tab + space (which works) and then navigate between the options with arrow and select an option with space (which is not yet implemented).

This probably isn't too hard to do, I will take a look if I can solve it in a fork and put up a PR if its good.

willsmanley avatar Jan 06 '25 18:01 willsmanley

If the selectedValue is null and you open the dropdown:

  • In material's DropdownButton, the first item is selected.
  • in DropdownButton2, no item will be selected (sound's reasonable to me) and you should press tab to start selecting an item.

https://github.com/user-attachments/assets/f860447b-ac02-4a41-9f57-e025d5f7a328

If there's a selectedValue and you open the dropdown, the item will be selected at both materials's DropdownButton and DropdownButton2:

https://github.com/user-attachments/assets/5e0af4aa-90d0-49f6-a320-80865962906e

AhmedLSayed9 avatar Jan 18 '25 05:01 AhmedLSayed9

I think the PR that I mentioned above is required for this to work (at least on the older API, I can't remember right now but I think there was some kind of recent API change. Maybe this only applies to the version I checked out there?)

willsmanley avatar Jan 18 '25 05:01 willsmanley

Ah yeah here's my comment about it: https://github.com/AhmedLSayed9/dropdown_button2/pull/340#issuecomment-2573820003

willsmanley avatar Jan 18 '25 05:01 willsmanley

The current version 3.0.0-beta.21 is safe to be used. Actually, it has some other important fixes.

Your PR fixes the issue on the stable release but introduces another issue (as commented above the line you've remove).

If you need to fix this on the stable release, you should apply the following commits: https://github.com/AhmedLSayed9/dropdown_button2/pull/185/commits/9a5116d2f68d203c3cc7c6917118f098ef48a174 https://github.com/AhmedLSayed9/dropdown_button2/pull/185/commits/d07364092c263e84d369dd50f1b2dc9acce19766

AhmedLSayed9 avatar Jan 18 '25 05:01 AhmedLSayed9

The beta version is just not released because I'm trying to implement the pagination feature before publishing version 3, which may require new apis and other breaking changes. But meh, I haven't found the time yet. I might just release it soon and postpone the pagination feature.

AhmedLSayed9 avatar Jan 18 '25 05:01 AhmedLSayed9

in DropdownButton2, no item will be selected (sound's reasonable to me) and you should press tab to start selecting an item.

It's even worse if the dropdown menu is on a TabView, because when you press tab, the TabView switches to the next tab and a dropdown menu doesn't close, it stays there on the screen (desktop app).

r3flow avatar Mar 10 '25 07:03 r3flow

in DropdownButton2, no item will be selected (sound's reasonable to me) and you should press tab to start selecting an item.

It's even worse if the dropdown menu is on a TabView, because when you press tab, the TabView switches to the next tab and a dropdown menu doesn't close, it stays there on the screen (desktop app).

Can you show a minimal sample that reproduces this?

AhmedLSayed9 avatar Mar 10 '25 15:03 AhmedLSayed9

in DropdownButton2, no item will be selected (sound's reasonable to me) and you should press tab to start selecting an item.

It's even worse if the dropdown menu is on a TabView, because when you press tab, the TabView switches to the next tab and a dropdown menu doesn't close, it stays there on the screen (desktop app).

Can you show a minimal sample that reproduces this?

I have same issue. When you release 3.0?

EliaTolin avatar Jun 11 '25 08:06 EliaTolin