Skip to content
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

Selection quirk in dropdown when using preact/compat #108

Open
gluck opened this issue Jun 7, 2022 · 2 comments
Open

Selection quirk in dropdown when using preact/compat #108

gluck opened this issue Jun 7, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@gluck
Copy link

gluck commented Jun 7, 2022

When using preact/compat (i.e. when any dependency uses React directly), onFocus event will bubble (to match React behavior):
preactjs/preact#3355

For dropdown this will cause a selection bug (mousedown on an item will trigger onFocus on the menu item, which will bubble up to the dropdown, which will call setSelected with the previous selected item, which will be highlighted instead until mouseup).

https://github.com/yuanqing/create-figma-plugin/blob/main/packages/ui/src/components/dropdown/dropdown.tsx#L111-L128

Probably many ways to fix that, here's the one I went with: divriots/create-figma-plugin-ui@b7ffa17

dropdown_quirk

@yuanqing yuanqing added the bug Something isn't working label Jun 9, 2022
@airtable-JayRansijn
Copy link

I was running into this as well, and took me a while to realize it was the dropdown and not my app logic. Thanks for logging this!

@HelixMorphe
Copy link

HelixMorphe commented Jun 20, 2023

How do I solve this in my plugin ? @yuanqing @gluck . Thanks in advance guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants