Fix dropdown interaction bug with DOM manipulation#229
Open
leejamesss wants to merge 1 commit intoweb-arena-x:mainfrom
Open
Fix dropdown interaction bug with DOM manipulation#229leejamesss wants to merge 1 commit intoweb-arena-x:mainfrom
leejamesss wants to merge 1 commit intoweb-arena-x:mainfrom
Conversation
|
Thanks for the work, but after applying these changes, when generating a report in shopping_admin and selecting the Period, the dropdown menu is still not visible in the accessibility tree. Did I miss something? action: click [2332] where [2332] is combobox 'Period' hasPopup: menu expanded: False |
|
Root Cause:
Modification Plan:
After modification, the dropdown menu will be visible and can be clicked: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Dropdown menus in Magento admin don't work, clicking them either redirects to Dashboard or does nothing.
This is related to #89, #121, and PR #112. The issue is that Playwright's accessibility tree updates before Magento's event handlers finish binding. When we click based on the tree saying an element is ready, the handlers aren't actually ready yet, so Magento's error handler kicks in and redirects.
Playwright also has a known popup menu rendering issue (microsoft/playwright#27142) that won't be fixed.
Solution
Check the element's role before clicking and handle dropdowns specially:
<option>elements: Use JavaScript to set.selectedand dispatch a change event directly, bypassing the accessibility tree.Changes
Added TreeNode infrastructure to track accessibility tree relationships, then updated the CLICK handler to detect and handle dropdown elements.
Code:
Testing
Tested in my modified environment, it fixes the dropdown issues. Can't guarantee it works in vanilla upstream though, would appreciate if you could test on the official setup, especially Magento dropdowns
References