-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix: dangling event listeners on menu #1071
Conversation
🦋 Changeset detectedLatest commit: 8dc8bbd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
callbacksToDispose.push(disposeKeydown); | ||
|
||
return () => { | ||
executeCallbacks(callbacksToDispose); |
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.
Nice catch on this one :)
packages/bits-ui/src/lib/bits/utilities/is-using-keyboard/is-using-keyboard.svelte.ts
Outdated
Show resolved
Hide resolved
Very nice work. Tbh, I hadn't even though of the idea of a global |
Not sure about this, but should I add a "minor" changeset because the new |
We just do everything "patch" while we're in pre-release mode so it's one flat changelog when we merge/release 1.0. Future majors will have appropriate patch/minor/major(breaking) changes annotated. I don't mind exporting I can do that once I'm done with work later unless you want to! Thanks again for this! |
Feel free to take it from here :) |
Fixes #1070
I took the opportunity to optimize the determination of the user's input mode (pointer or keyboard). Now, only three event listeners are registered and can be shared between multiple components.
I took inspiration from @huntabyte's branch
fix/focus-scoping
where a classIsUsingKeyboard
is already implemented.Many thanks to @chbert with whom I troubleshot this issue extensively :)