Skip to content

@click not fired in elements inside a v-close-popper #1015

@afv

Description

@afv

Hello,

Between 5.1.0 and 5.1.1 the @click in elements inside a v-close-popper stopped working (expectation: click works and the popper closes): https://codesandbox.io/p/sandbox/floating-vue-click-5m6mm6

Is it supposed to work like this?

Thanks!

Edit: @kouts @mousedown works.

Linked example:

<template>
  <div class="main">
    <VDropdown>
      <button>Open popper</button>
      <template #popper>
        <div v-close-popper>
          <div>1) Close on click OK</div>
          <div @click="doSomething">2) @click (stopped working on 5.1.1)</div>
          <div @mousedown="doSomething">3) @mousedown (works)</div>
        </div>
      </template>
    </VDropdown>

    <br /><br /><br /><br />
    {{ list }}
  </div>
</template>

<script setup>
import { ref } from "vue";

const list = ref([]);

function doSomething() {
  list.value.push(new Date());
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions