Skip to content

Menu should open on first click and close again on second click #299

@Martino-Martinez

Description

@Martino-Martinez

Vue3-Select-Component version

latest

Link to minimal reproduction

n/a

Steps to reproduce

n/a

What is expected?

Menu should open on first click, and close when clicked again. This is how the standard select works. Since we also have a search input, this should only happened when nothing is entered in the search input.

What is actually happening?

n/a

Any additional comments?

Implementation:

// -----------------------------------------
function handleControlClick(event: MouseEvent)
{
  if (indicatorsRef.value?.containerRef && !indicatorsRef.value.containerRef.contains(event.target as Node))
  {
    if (menuOpen.value && !search.value)
      closeMenu();
    else
      openMenu();
  }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions