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
#6904: Stop propagation of certain events in QuickBar #7686
Conversation
<KBarSearch style={searchStyle} /> | ||
<QuickBarResults /> | ||
</FocusLock> | ||
</StopPropagation> | ||
</Stylesheets> | ||
</EmotionShadowRoot.div> |
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.
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.
Hmm, it was switched from closed to open when we switched libraries: https://github.com/pixiebrix/pixiebrix-extension/pull/5750/files#diff-50f2a63c2398eca75310e434d2dc90a762b23dd6591766e05b68d38a5e00c3a8L122. That wasn't flagged during that PR
I agree it should likely be closed - host sites shouldn't need to snoop on the individual events within the Quick Bar
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.
I closed it now 👌
@grahamlangford this change will need to be tested on Salesforce, Pipedrive, Zendesk and other platforms supporting hotkeys @fregante what's the reasoning behind dropping focus lock? Any additional investigation beyond the issue?: #6904 (comment). From my original commit, it seems like it was added because some apps might have tried stealing focus away (I don't remember if that was in response to hotkey or not)?: #5173 |
I looked at the original implementation and it mentioned "stealing key presses" rather than focus. The focus change was probably a consequence of the key press going through. |
The QuickBar seems to work correctly even without it, automatically catching the keypresses and restoring focus. Here I had a Screen.Recording.9.movThe focus lock component might be useful in the future, but it seems that kbar + |
I created a playground here: https://pbx.vercel.app/site-with-hotkeys/ As mentioned in the issue, we can't really prevent the document from seeing the events if they use I'll add an |
This reverts commit 2f242f5.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7686 +/- ##
==========================================
+ Coverage 72.54% 72.55% +0.01%
==========================================
Files 1259 1260 +1
Lines 39264 39277 +13
Branches 7326 7328 +2
==========================================
+ Hits 28484 28498 +14
+ Misses 10780 10779 -1 ☔ View full report in Codecov by Sentry. |
I'll have to try this on Salesforce, etc. IIRC, the problem was that some sites have key event handlers on document with The |
What does this PR do?
Demo
Screen.Recording.2.mov
Checklist
src/tsconfig.strictNullChecks.json
(if possible)