* Fixed #2689 - fix Portal mounted, fix onBlur method in Calendar * Fixed #2689 - revert accidentally changed line Co-authored-by: Alex Popov <al@twentyoneskills.com>pull/2722/head
parent
7a38d05b7a
commit
c3204e9200
|
@ -5,7 +5,7 @@
|
||||||
<CalendarButton v-if="showIcon" :icon="icon" tabindex="-1" class="p-datepicker-trigger" :disabled="$attrs.disabled" @click="onButtonClick" type="button" :aria-label="inputFieldValue"/>
|
<CalendarButton v-if="showIcon" :icon="icon" tabindex="-1" class="p-datepicker-trigger" :disabled="$attrs.disabled" @click="onButtonClick" type="button" :aria-label="inputFieldValue"/>
|
||||||
<Portal :appendTo="appendTo" :disabled="inline">
|
<Portal :appendTo="appendTo" :disabled="inline">
|
||||||
<transition name="p-connected-overlay" @enter="onOverlayEnter($event)" @after-enter="onOverlayEnterComplete" @after-leave="onOverlayAfterLeave" @leave="onOverlayLeave">
|
<transition name="p-connected-overlay" @enter="onOverlayEnter($event)" @after-enter="onOverlayEnterComplete" @after-leave="onOverlayAfterLeave" @leave="onOverlayLeave">
|
||||||
<div :ref="overlayRef" :class="panelStyleClass" v-if="inline ? true : overlayVisible" :role="inline ? null : 'dialog'" @click="onOverlayClick" @mouseup="onOverlayMouseUp">
|
<div :ref="overlayRef" :class="panelStyleClass" v-if="inline || overlayVisible" :role="inline ? null : 'dialog'" @click="onOverlayClick" @mouseup="onOverlayMouseUp">
|
||||||
<template v-if="!timeOnly">
|
<template v-if="!timeOnly">
|
||||||
<div class="p-datepicker-group-container">
|
<div class="p-datepicker-group-container">
|
||||||
<div class="p-datepicker-group" v-for="(month,groupIndex) of months" :key="month.month + month.year">
|
<div class="p-datepicker-group" v-for="(month,groupIndex) of months" :key="month.month + month.year">
|
||||||
|
@ -2190,10 +2190,10 @@ export default {
|
||||||
this.$emit('focus', event);
|
this.$emit('focus', event);
|
||||||
},
|
},
|
||||||
onBlur(event) {
|
onBlur(event) {
|
||||||
this.$emit('blur', {originalEvent: event, value: this.input.value});
|
this.$emit('blur', {originalEvent: event, value: event.target.value});
|
||||||
|
|
||||||
this.focused = false;
|
this.focused = false;
|
||||||
this.input.value = this.formatValue(this.modelValue);
|
event.target.value = this.formatValue(this.modelValue);
|
||||||
},
|
},
|
||||||
onKeyDown(event) {
|
onKeyDown(event) {
|
||||||
if (event.keyCode === 40 && this.overlay) {
|
if (event.keyCode === 40 && this.overlay) {
|
||||||
|
|
|
@ -2,12 +2,10 @@
|
||||||
<template v-if="inline">
|
<template v-if="inline">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="mounted">
|
<Teleport v-else-if="isClient" :to="appendTo">
|
||||||
<Teleport :to="appendTo">
|
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { DomHandler } from 'primevue/utils';
|
import { DomHandler } from 'primevue/utils';
|
||||||
|
@ -24,17 +22,12 @@ export default {
|
||||||
default: false
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mounted: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.mounted = DomHandler.isClient();
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
inline() {
|
inline() {
|
||||||
return this.disabled || this.appendTo === 'self';
|
return this.disabled || this.appendTo === 'self';
|
||||||
|
},
|
||||||
|
isClient () {
|
||||||
|
return DomHandler.isClient()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue