Fixed #1048 - Date Filter Error on DataTable
parent
bfd3e5847b
commit
301781e3e0
|
@ -7,6 +7,7 @@
|
||||||
:class="{'p-column-filter-menu-button-open': overlayVisible, 'p-column-filter-menu-button-active': hasFilter()}"
|
:class="{'p-column-filter-menu-button-open': overlayVisible, 'p-column-filter-menu-button-active': hasFilter()}"
|
||||||
@click="toggleMenu()" @keydown="onToggleButtonKeyDown($event)"><span class="pi pi-filter-icon pi-filter"></span></button>
|
@click="toggleMenu()" @keydown="onToggleButtonKeyDown($event)"><span class="pi pi-filter-icon pi-filter"></span></button>
|
||||||
<button v-if="showMenuButton && display === 'row'" :class="{'p-hidden-space': !hasRowFilter()}" type="button" class="p-column-filter-clear-button p-link" @click="clearFilter()"><span class="pi pi-filter-slash"></span></button>
|
<button v-if="showMenuButton && display === 'row'" :class="{'p-hidden-space': !hasRowFilter()}" type="button" class="p-column-filter-clear-button p-link" @click="clearFilter()"><span class="pi pi-filter-slash"></span></button>
|
||||||
|
<Teleport to="body">
|
||||||
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave">
|
<transition name="p-connected-overlay" @enter="onOverlayEnter" @leave="onOverlayLeave">
|
||||||
<div :ref="overlayRef" :class="overlayClass" v-if="overlayVisible" @keydown.escape="onEscape" @click="onContentClick">
|
<div :ref="overlayRef" :class="overlayClass" v-if="overlayVisible" @keydown.escape="onEscape" @click="onContentClick">
|
||||||
<component :is="filterHeaderTemplate" :field="field" :filterModel="filters[field]" :filterCallback="filterCallback" />
|
<component :is="filterHeaderTemplate" :field="field" :filterModel="filters[field]" :filterCallback="filterCallback" />
|
||||||
|
@ -48,11 +49,13 @@
|
||||||
<component :is="filterFooterTemplate" :field="field" :filterModel="filters[field]" :filterCallback="filterCallback" />
|
<component :is="filterFooterTemplate" :field="field" :filterModel="filters[field]" :filterCallback="filterCallback" />
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
</Teleport>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {DomHandler,ConnectedOverlayScrollHandler} from 'primevue/utils';
|
import {DomHandler,ConnectedOverlayScrollHandler} from 'primevue/utils';
|
||||||
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
||||||
import {FilterOperator} from 'primevue/api';
|
import {FilterOperator} from 'primevue/api';
|
||||||
import Dropdown from 'primevue/dropdown';
|
import Dropdown from 'primevue/dropdown';
|
||||||
import Button from 'primevue/button';
|
import Button from 'primevue/button';
|
||||||
|
@ -141,7 +144,6 @@ export default {
|
||||||
selfClick: false,
|
selfClick: false,
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
if (this.overlay) {
|
if (this.overlay) {
|
||||||
this.$el.appendChild(this.overlay);
|
|
||||||
this.onOverlayHide();
|
this.onOverlayHide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -349,6 +351,12 @@ export default {
|
||||||
this.bindOutsideClickListener();
|
this.bindOutsideClickListener();
|
||||||
this.bindScrollListener();
|
this.bindScrollListener();
|
||||||
this.bindResizeListener();
|
this.bindResizeListener();
|
||||||
|
|
||||||
|
OverlayEventBus.on('overlay-click', e => {
|
||||||
|
if (this.overlay.contains(e.target)) {
|
||||||
|
this.selfClick = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onOverlayLeave() {
|
onOverlayLeave() {
|
||||||
this.onOverlayHide();
|
this.onOverlayHide();
|
||||||
|
@ -358,6 +366,7 @@ export default {
|
||||||
this.unbindResizeListener();
|
this.unbindResizeListener();
|
||||||
this.unbindScrollListener();
|
this.unbindScrollListener();
|
||||||
this.overlay = null;
|
this.overlay = null;
|
||||||
|
OverlayEventBus.off('overlay-click');
|
||||||
},
|
},
|
||||||
overlayRef(el) {
|
overlayRef(el) {
|
||||||
this.overlay = el;
|
this.overlay = el;
|
||||||
|
@ -380,6 +389,7 @@ export default {
|
||||||
if (this.outsideClickListener) {
|
if (this.outsideClickListener) {
|
||||||
document.removeEventListener('click', this.outsideClickListener);
|
document.removeEventListener('click', this.outsideClickListener);
|
||||||
this.outsideClickListener = null;
|
this.outsideClickListener = null;
|
||||||
|
this.selfClick = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
bindScrollListener() {
|
bindScrollListener() {
|
||||||
|
|
Loading…
Reference in New Issue