-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Don't close sticker picker if shift is pressed when sending stickers #6477
base: main
Are you sure you want to change the base?
Conversation
361d230
to
34c28cf
Compare
34c28cf
to
4937dd5
Compare
Dunno if that's necessary but I rebased/updated my branch. |
c3e427b
to
d276c29
Compare
d276c29
to
80d19c4
Compare
80d19c4
to
0b7f09f
Compare
Hi, the PR is now rebased for v6.29.0.beta-1. It was also tested again to make sure it is still working properly. Lmk if there's anything that should be changed. |
@@ -70,6 +70,8 @@ export const StickerButton = React.memo(function StickerButtonInner({ | |||
}: Props) { | |||
const [open, internalSetOpen] = React.useState(false); | |||
|
|||
const [shiftHeld, setShiftHeld] = React.useState(false); |
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 rework this to just check event.shiftKey
on the click event instead of tracking additional state
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 see your comment below about event.shiftKey
, but I think you mean event.shiftKey
shouldn't be used for updating setShiftHeld
. If you aren't trying to track the state I don't think this is a problem?
@@ -103,23 +109,31 @@ export const StickerButton = React.memo(function StickerButtonInner({ | |||
installedPacks, | |||
onClickAddPack, | |||
popperRoot, | |||
setRecentStickersState, | |||
recentStickers, | |||
setOpen, | |||
]); | |||
|
|||
const handlePickSticker = React.useCallback( | |||
(packId: string, stickerId: number, url: string) => { |
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.
If you go into the StickerPicker
component you can pass the event into this method
Thank you for this PR, apologies for it taking this long to get reviewed |
0b7f09f
to
fd015c6
Compare
fd015c6
to
bdec880
Compare
No worries, I know how busy y'all have been recently. I made the following changes using your feedback, let me know if these are okay:
|
First time contributor checklist:
Contributor checklist:
main
branchyarn ready
run passes successfully (more about tests here)Description
On the mobile apps, the sticker picker stays open when we send stickers, until we decide to close it. This is useful if you want to send multiple stickers quickly. But on Desktop, the interface has to be different, and currently the sticker picker automatically closes right after sending a sticker. This is nice, but if we want to send multiple stickers quickly, we need to reopen the sticker picker, find the sticker pack we want, resend sticker etc.
This PR adds the ability to prevent the sticker picker from closing when we send a sticker if the shift key is held down.
Things to mention: