-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
feat: Added option for sticky display of variants panel with a single click #2554
Conversation
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.
Thanks for the PR!
Looks good overall, but see two inline comments.
@@ -1135,19 +1135,21 @@ function handlePointerDown(ev: PointerEvent) { | |||
} | |||
|
|||
if (keycap.variants) { | |||
if (pressAndHoldTimer) clearTimeout(pressAndHoldTimer); |
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.
Could you explain why clearing the timer had to be removed?
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.
It seems like I mistakenly removed it, so I’ll restore it.
src/public/virtual-keyboard.ts
Outdated
@@ -98,6 +98,9 @@ export interface VirtualKeyboardKeycap { | |||
|
|||
/** Name of the layer to shift to when the key is pressed */ | |||
layer: string; | |||
|
|||
/** Open variants panel without long press and does not close automatically */ | |||
popover: boolean; |
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 would probably go with something a bit more descriptive. Maybe stickyVariantPanel
?
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.
That's a good name.
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.
Looks good. Thanks!
fix #2549
Overview
This PR adds a
stickyVariantPanel
option to the VirtualKeyboardKeycap. When this option is enabled, clicking on a key with variants configured will display the Variants Panel without a long press. Additionally, the panel will not automatically hide.The motivation for implementing this feature is described in #2549, and a similar request can be found in #2363.
Notes