-
Notifications
You must be signed in to change notification settings - Fork 80
[Modal / Popover] Search Widget not receiving click event if Modal / Popover open after initial load #6581
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
Comments
It looks like this issue is missing some information:
Issues without reproduction samples may not be prioritized. If you were unable to create a sample, please try to answer any questions that arise once development begins. Thanks for your understanding. |
Research will be conducted to determine next steps in May, as it relates to focus trap. |
Sharing workaround suggested by @driskull: using |
- Uses the component's host element for the focus trap - Sets up a mutation observer to update focusable elements when new elements are slotted - If no focusable elements are found it will just call setFocus on the component.
**Related Issue:** #6581 ## Summary - Uses the component's host element for the focus trap. This seems to fix the issue in the related PR. I guess we should always use the host element in order to not run into any issues. Previously, it was using an element inside the shadowRoot. - Sets up a mutation observer to update focusable elements when new elements are slotted - Remove setting tabIndex on an element as a fallback
Installed and assigned for verification. |
Verified with |
Uh oh!
There was an error while loading. Please reload this page.
Actual Behavior
This was brought to our attention by a developer customer at Dev Summit. When using the Search Widget within a Modal that is not open on load, the Search Widget does not respond to the first click in its search results when within the Modal.
This is not evident if the Modal is open at load, and I was unable to reproduce with other elements besides the Search Widget. I also tested and was able to reproduce in Popover, leading me to believe there is some issue with the focus trap functionality.
Expected Behavior
As a developer customer, I can use the Maps SDK for Javascript Search Widget (https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-customsource/) within a Modal, not open at load, and have the initial click on the results list within the Search Widget function as expected.
Reproduction Sample
Codepen
Reproduction Steps
1 - Navigate to Codepen
2 - Open the Modal via button
3 - Enter a search term
4 - Click on an item in the result list.
5 - The console log should not fire.
6 - Subsequent clicks should fire the console log.
7 - Edit the sample code to have the Modal
open
on load8 - Observe that the console log DOES fire on same click
9 - Change the Modal element to a Popover and observe the same behavior.
Reproduction Version
1.0.7
Relevant Info
We went back and forth with Maps SDK on this one, it's replicable with the Search Widget, but not with other elements (Calcite or native) within the Modal / Popover.
Regression?
Priority impact
p1 - need for current milestone
Impact
Affecting multiple components, end users.
Esri team
Calcite (design)
The text was updated successfully, but these errors were encountered: