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).
When using
preact/compat
(i.e. when any dependency uses React directly),onFocus
event will bubble (to match React behavior): https://github.com/preactjs/preact/pull/3355For 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: https://github.com/divriots/create-figma-plugin-ui/commit/b7ffa1738ebe6859eb4c5aefa2b73dbbe9adcce3