artsy / palette

Artsy's design system
https://palette-storybook.artsy.net/
MIT License
215 stars 45 forks source link

fix: fixes long press on AutocompleteInputOption #1361

Closed nickskalkin closed 9 months ago

nickskalkin commented 9 months ago

PR that originated this issue: https://github.com/artsy/force/pull/13396

The problem is that when user presses on an option, in handleMouseDown function UI gets cleared (dropdown destroyed) after 100ms delay. If user keeps mouse pressed - dropdown UI is cleared before user releases the mouse button. But seems like router links (that are inside options) start handling redirect only after user releases mouse. But at this point of time there are no links in DOM, so redirects are not handled.

onClick will wait until user releases the mouse button, and only after that will clear UI.

artsyit commented 9 months ago

:rocket: PR was released in @artsy/palette-charts@37.1.1, @artsy/palette@38.1.1 :rocket: