refactor: polish OlPopover and OlSelectPopover behavior#12680
Merged
Conversation
- OlPopover: route trigger-click close through _requestClose so it emits a cancelable ol-popover-close event (reason: 'trigger'), matching escape/outside-click paths. - OlSelectPopover: move chevron after the label in the default trigger; skip filter auto-focus on mobile (≤767px) so opening the popover doesn't pop the soft keyboard and shrink the list area.
Contributor
There was a problem hiding this comment.
Pull request overview
Refines the behavior of the Lit-based popover components (ol-popover and ol-select-popover) to improve event consistency and mobile UX.
Changes:
OlPopover: trigger-click close now routes through_requestClose('trigger'), making it emit a cancelableol-popover-closeevent (consistent with escape/outside-click).OlSelectPopover: adjusts the default trigger layout to render chevron after the label, and skips auto-focusing the filter input on mobile-sized viewports to avoid popping up the soft keyboard.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| openlibrary/components/lit/OlPopover.js | Makes trigger-close emit the same cancelable close event path as other dismissal reasons; updates event reason docs. |
| openlibrary/components/lit/OlSelectPopover.js | Tweaks default trigger visual order and avoids mobile auto-focus of the filter input. |
This was referenced May 17, 2026
Open
Contributor
Screen.Recording.2026-05-20.023513.mp4Update: I retested. after refetching the latest changes and building again locally. |
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.
Two small refinements to the Lit popover components introduced in #12635 following a meeting w/ @cdrini @mekarpeles @RayBB @Armansiddiqui9
Technical
data-openattribute that OlSelectPopover toggles in response tool-popover-close. The trigger-click path was settingopen = falsedirectly and skipping that event, so the attribute (and the chevron) got stuck in the open state. Trigger close now goes through the same_requestClosepath as escape/outside-click so the event fires.≤767px, matchingol-popover's tray breakpoint). Previously, opening the popover on a touch device would pop up the soft keyboard and shrink the visible list area. Desktop behavior is unchanged: the filter still gets focus so the user can type immediately.Testing
Screenshot
Stakeholders
@cdrini