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

click outside is triggered inside the element with v-for #614

Open
handhikadj opened this issue Oct 23, 2022 · 1 comment
Open

click outside is triggered inside the element with v-for #614

handhikadj opened this issue Oct 23, 2022 · 1 comment

Comments

@handhikadj
Copy link

go to: https://codesandbox.io/s/unruffled-shirley-0x72r6?file=/src/App.vue

click inside the element. see console

@DaanDL
Copy link

DaanDL commented Mar 27, 2023

Works as intended.

You click inside one of the red boxes, meaning that you don't click in one of the four other boxes, so you get four messages. Click in the white area, and you get five messages, simple as that :-)

If you don't like this behaviour, just wrap it like this:

<div id="app" style="display: flex; gap: 10px">
    <div style="display: flex; gap: 10px" v-click-outside="showClickAway">
      <div
      v-for="(item, index) in myItems"
      :key="index"
      class="my-item">
      {{ item }}
      </div>
    </div>
  </div>

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