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

Dropdown toggle bug #970

Open
Boilingwaterr opened this issue Aug 17, 2021 · 1 comment
Open

Dropdown toggle bug #970

Boilingwaterr opened this issue Aug 17, 2021 · 1 comment

Comments

@Boilingwaterr
Copy link

Boilingwaterr commented Aug 17, 2021

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]
@soetji
Copy link

soetji commented Sep 27, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants