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

Duplicate events when using open.sync #376

Closed
pvlcor opened this issue Oct 21, 2019 · 4 comments
Closed

Duplicate events when using open.sync #376

pvlcor opened this issue Oct 21, 2019 · 4 comments

Comments

@pvlcor
Copy link

pvlcor commented Oct 21, 2019

Current behaviour:

  • When using .sync on open prop, VPopover emits 2 times hide/show and update events
    image

Expected behaviour:

  • hide/show and update events are emitted only once
@laurensiusadi
Copy link

Why is the popover component emitting hide event when it's not opened yet?

@jkohlin
Copy link

jkohlin commented Mar 2, 2021

I have a similar issue, v-popover emits update:open(false) twice when I close the popover by clicking on my popover-button

…
<v-popover
  @update:open="callForBenchmark"
>
  <button>Benchmark</button>
  <dropdown-benchmarks
    ref="benchmark"
    slot="popover"
    :card="card"
    @update:benchmark="saveBenchmark"
  />
</v-popover>
</template>
<script>
…
methods:{
  callForBenchmark(open) {
    console.log(`callForBenchmark.open: ${open}`);
    if (!open && this.$refs.benchmark) {
      this.$refs.benchmark.saveBenchmark();
    }
  },
  saveBenchmark(payload) {
    this.card.save()
  },
}

In DropdownBenchmark:

saveBenchmark() {
      this.$emit('update:benchmark',this.benchmarks),
    },
```

@Lanuitjedanse
Copy link

I also have this issue (all hide and show events are duplicated), do you plan on fixing it soon?
Or do you have a recommended solution?

@dev-steverob
Copy link

I had similar issue when using hover menu and I got around it by doing debounce on the function to only trigger after 300ms if different from the previous state and this stopped the duplicate calls

Akryum added a commit that referenced this issue Mar 11, 2022
@Akryum Akryum closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants