Fixed #1528 - Prevent overlay from closing when clicking on a label inside (#1527)

Hi,
On this PR https://github.com/primefaces/primevue/pull/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
pull/1544/head
Melek REBAI 2021-09-14 10:56:23 +01:00 committed by GitHub
parent 3723548c43
commit 121054cc67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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>