fix(time-picker): added popperRef in picker to Fix issue #1809 (#1812)

Added usage of popperRef arg in clickoutside directive in picker to fix issue #1809

fix ##1809
This commit is contained in:
Mike Saprykin 2021-04-11 15:58:25 +03:00 committed by GitHub
parent 270a4f96ad
commit fbf34667a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@
<template #trigger>
<el-input
v-if="!isRangeInput"
v-clickoutside="onClickOutside"
v-clickoutside:[popperPaneRef]="onClickOutside"
:model-value="displayValue"
:name="name"
:size="pickerSize"
@ -53,7 +53,7 @@
</el-input>
<div
v-else
v-clickoutside="onClickOutside"
v-clickoutside:[popperPaneRef]="onClickOutside"
class="el-date-editor el-range-editor el-input__inner"
:class="[
'el-date-editor--' + type,
@ -347,6 +347,11 @@ export default defineComponent({
const pickerSize = computed(() => {
return props.size || elFormItem.size || ELEMENT.size
})
const popperPaneRef = computed(() => {
return refPopper.value?.popperRef
})
const onClickOutside = () => {
if (!pickerVisible.value) return
pickerVisible.value = false
@ -496,6 +501,7 @@ export default defineComponent({
onUserInput,
handleChange,
handleKeydown,
popperPaneRef,
onClickOutside,
pickerSize,
isRangeInput,