Skip to content

handleCaretClick does not work on custom caret #320

@antpngl92

Description

@antpngl92

Version

  • Vue: 3.2.37
  • multiselect: 2.5.8
  • nuxt: 3.0.0

Description

When I try to use custom caret the handleCaretClick does not work.

    <template #caret>
        <span
          aria-hidden="true"
          @click="handleCaretClick"
        >
          <nuxt-icon
            :name="`arrow_down${isSortBy() ? '_small' : ''}`"
            :class="[
              {'dropdown-single-select__icon--up': multiselect?.isOpen}
            ]"
          />
        </span>
      </template>
<script setup lang="ts">
const multiselect = ref<MultiselectRef>();
const handleCaretClick = ref();

onMounted(() => {
  handleCaretClick.value = (multiselect.value as any)?.handleCaretClick
});
</script>

It opens and closes the options list immediately. If I hold the button (mouseDown) the list stays open, as soon as I release it (mouseUp) the list closes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions