Skip to content

DropDownTree selection can be broken when using multiple instances on the same component #208

Closed
@elias551

Description

@elias551

Describe the bug
When using two or more DropDownTree components in the same page, sometimes clicks for selecting a dropdown do not unselect the previously selected dropdown.

To Reproduce
https://codesandbox.io/s/j2z20j56rw

  1. click on the first dropdown
  2. select an element
  3. click on the second dropdown

Result: Both dropdowns are open

Expected behavior

There should only be only one dropdown selected or opened at a time

Screenshots

image

Environment (please complete the following information):
Reproducible on any browser

Additional context
It seems like the function utils/isOutsideClick can detect if the dropdowns are different only if the className property is different, maybe an additional generated key by component instance could fix this method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions