floating-vue icon indicating copy to clipboard operation
floating-vue copied to clipboard

Stop propagation of events

Open Hysow opened this issue 3 years ago • 3 comments

I can't find a way to Stop Propagation on click event properly. I've used a Hack by adding :shown.sync="isShown" :triggers="[]" props on v-dropdown wrapped inside a div with @click.event="isShown = true attribute.

  <div @click.stop="isShown = true">
    <v-dropdown
      v-on="$listeners"
      v-bind="[$props, $attrs]"
      :shown.sync="isShown"
      :triggers="[]"
    >
      <slot/>
      <template #popper>
        <slot name="dropdown"></slot>
      </template>
    </v-dropdown>
  </div>

Is there another way to do it? otherwise, it would be nice to implement it. :smile:

Hysow avatar Apr 28 '22 16:04 Hysow

Same question for two superposed elements having both tooltips, how to stop propagation of trigger event to not show both tooltips ? image

sylvainpolletvillard avatar Apr 29 '22 16:04 sylvainpolletvillard

Probably because the events are setup as passive :thinking:

Akryum avatar May 30 '22 08:05 Akryum

Probably, yes. That prevents us to manually control the propagation of the event. You setup the events as passive for performance improvements I guess ?

sylvainpolletvillard avatar May 30 '22 10:05 sylvainpolletvillard