-
Notifications
You must be signed in to change notification settings - Fork 307
fix: #1067 dropdown broken on Safari #1634
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
base: main
Are you sure you want to change the base?
fix: #1067 dropdown broken on Safari #1634
Conversation
@cameront is attempting to deploy a commit to the Themesberg Team on Vercel. A member of the Team first needs to authorize it. |
""" WalkthroughThe changes refactor popover open/close/toggle logic in Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PopperComponent
participant DebounceManager
User->>PopperComponent: Triggers open/close/toggle event
PopperComponent->>DebounceManager: start_change(nextOpen, interactive)
DebounceManager-->>PopperComponent: (after triggerDelay) finish_change()
PopperComponent->>PopoverState: Update isOpen
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/lib/utils/Popper.svelte
(6 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
src/lib/utils/Popper.svelte (1)
Learnt from: mrh1997
PR: themesberg/flowbite-svelte#1442
File: src/lib/utils/Popper.svelte:144-145
Timestamp: 2024-11-22T08:37:27.996Z
Learning: In `src/lib/utils/Popper.svelte`, inconsistencies in event handling (e.g., using both `mouseenter`/`mouseleave` and `pointerenter`/`pointerleave`) may be intentional to minimize modifications and reduce the risk of new problems.
🪛 ESLint
src/lib/utils/Popper.svelte
[error] 192-192: 'NodeJS' is not defined.
(no-undef)
🔇 Additional comments (3)
src/lib/utils/Popper.svelte (3)
52-60
: LGTM! Clean transition to debounced state management.The change properly delegates the open action to the debouncing system and correctly marks it as interactive.
62-69
: Good addition of toggle functionality.The new toggle function properly integrates with the debouncing system and maintains consistency with other event handlers.
121-128
: Correct handling of programmatic state changes.The change properly marks toggle events as non-interactive, allowing the debouncing system to prioritize programmatic control over user interactions.
369b29f
to
29cd585
Compare
Closes #1067
📑 Description
When looking into #1067, I found that the Popper element used by Dropdown contained some race conditions when managing two-way-bound state of
isOpen
This PR delays the processing of the two popover state-changing paths (interactive events, and the changing of is_open) in order to simplify state management. This also results in unifying dropdown behavior on chrome and safari.
I know that the Popper element is used by elements other than Dropdown, but as far as I can tell (logically and via interacting with them in the examples) this PR shouldn't negatively those elements.
Status
✅ Checks
Summary by CodeRabbit