jodhman / react-eyedrop

Seamlessly integrate a static typed, fully-tested color-picking React component/hook!
24 stars 11 forks source link

reset cursor to default on unmounting #53

Closed theunexpected1 closed 2 years ago

theunexpected1 commented 2 years ago

The cursor remains in active state even when the component unmounts (if the user did not pick any color).

Steps to reproduce:

  1. use react-eyedrop within a dialog box (eg: Popper) and set cursorActive to "crosshair"
  2. enable picking state (onPickStart), but don't pick any color
  3. Trigger closing of the Popper dialog
  4. body's cursor remains "crosshair" instead of reverting to "default"
jodhman commented 2 years ago

Hello @theunexpected1! Thank you for reporting this issue. I'll make sure to push a fix for the react-eyedrop component within few days. If you're using the hook, I'd advise you to manually call the cancelPickColor method.

jodhman commented 2 years ago

Give it a go in version 5.3.2. :smile: