react-overlays icon indicating copy to clipboard operation
react-overlays copied to clipboard

Dropdown toggle bug

Open Boilingwaterr opened this issue 4 years ago • 1 comments

Toggle handler has an error in the interface

image

To Reproduce it open sandbox

Steps to reproduce the behavior:

  1. Create dropdown with Dropdown component
  2. Pass an onToggle function as a props
  3. Click it
  4. See an error

Reproducible Example

Minimal example by using CodeSandbox.

Expected behavior

Flag show should be boolean

Received

false or event image

Environment

  • Browser, Version [e.g. Chrome 74]
  • react-overlays Version [e.g. 2.0.0]

Boilingwaterr avatar Aug 17 '21 20:08 Boilingwaterr

I have this issue too with react-overlays version 5.1.1.

It happens when I use the toggle from useDropdownToggle in the onClick for my button element. The show from useDropdownToggle becomes an event object when it is supposed to be true. It works when I don't have toggle on the onClick. See on the codesandbox below.

https://codesandbox.io/s/react-playground-forked-3xe86?file=/DropDownBar.js

soetji avatar Sep 27 '21 16:09 soetji