mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 11:17:46 +08:00
fix(components): [time-picker] cancel button not work correctly (#6735)
This commit is contained in:
parent
ae33485f5a
commit
0d11c121b6
@ -491,9 +491,13 @@ describe('TimePicker(range)', () => {
|
||||
// For skipping Transition animation
|
||||
await rAF()
|
||||
;(document.querySelector('.el-time-panel__btn.cancel') as any).click()
|
||||
await nextTick()
|
||||
await rAF()
|
||||
const vm = wrapper.vm as any
|
||||
expect(vm.value).toEqual(cancelDates)
|
||||
expect((wrapper.findComponent(Picker).vm as any).pickerVisible).toEqual(
|
||||
false
|
||||
)
|
||||
expect(document.querySelector('.el-picker-panel')).toBeNull()
|
||||
input.trigger('blur')
|
||||
input.trigger('focus')
|
||||
await nextTick()
|
||||
|
@ -112,7 +112,7 @@ export default defineComponent({
|
||||
const maxDate = computed(() => props.parsedValue[1])
|
||||
const oldValue = useOldValue(props)
|
||||
const handleCancel = () => {
|
||||
ctx.emit('pick', oldValue.value, null)
|
||||
ctx.emit('pick', oldValue.value, false)
|
||||
}
|
||||
const showSeconds = computed(() => {
|
||||
return props.format.includes('ss')
|
||||
|
Loading…
Reference in New Issue
Block a user