Skip to content

Commit

Permalink
Fixed #1528 - Prevent overlay from closing when clicking on a label i…
Browse files Browse the repository at this point in the history
…nside (#1527)

Hi,
On this PR #1361 the event used for checking if the click is inside the overlay was changed from @click to @mousedown
This caused the overlay to hide when clicking on a <label> tag within the overlay

In this PR, i'm adding a listener for the click event that calls onContentClick function

I tested this change locally and now both clicking on a label or trying to select text work both fine
  • Loading branch information
shadoWalker89 authored Sep 14, 2021
1 parent 3723548 commit 121054c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/overlaypanel/OverlayPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Teleport :to="appendTo">
<transition name="p-overlaypanel" @enter="onEnter" @leave="onLeave" @after-leave="onAfterLeave">
<div :class="containerClass" v-if="visible" :ref="containerRef" v-bind="$attrs" @click="onOverlayClick">
<div class="p-overlaypanel-content" @mousedown="onContentClick">
<div class="p-overlaypanel-content" @click="onContentClick" @mousedown="onContentClick">
<slot></slot>
</div>
<button class="p-overlaypanel-close p-link" @click="hide" v-if="showCloseIcon" :aria-label="ariaCloseLabel" type="button" v-ripple>
Expand Down

0 comments on commit 121054c

Please sign in to comment.