Fix power-select with closeOnSelect=false nested within basic-dropdown#1512
Fix power-select with closeOnSelect=false nested within basic-dropdown#1512jamescdavis wants to merge 2 commits intocibernox:masterfrom
Conversation
f60a821 to
a323c19
Compare
|
@calvin-fb any ideas on a proper fix? |
|
@matthew-robertson tagging you as well |
|
@jamescdavis Interesting. I just played around with it a bit and I found that if I pass |
|
So the issue is with this block in ember-basic-dropdown: In terms of fixing it... one hacky fix would be adding |
Overriding
aria-controlson the dropdown trigger causes issues when a power-select is nested within a basic-dropdown and@closeOnSelect={{false}}is set on the power-select. Specifically, the parent dropdown is erroneously closed when an option is selected. This change was introduced in bb1b8e9 as part of #1481.cibernox/ember-basic-dropdown#633 is the ember-basic-dropdown PR that made it not ok to override
aria-controlssince it uses this to build a relationship between the trigger and content.Repro: https://github.com/jamescdavis/power-select-nested-dropdown-repro/blob/main/app/templates/application.hbs
(this repro uses
PowerSelectMultiplebut the behavior is the same forPowerSelect)This PR adds a failing test for the issue along with a couple of smoke tests for nested power-select. It also includes a commit that simply removes the
aria-controlsoverride, which makes the failing tests pass and resolves the bug, but I'm sure is not the desired resolution (and obviously makes a11y tests fail). I am as of yet uncertain how to fix this properly.