mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-19 23:13:52 +00:00
perf: 滑动列表自动隐藏键盘
This commit is contained in:
parent
55a922c7b3
commit
9be0642ba5
@ -243,6 +243,17 @@ export default {
|
||||
}, 300)
|
||||
},
|
||||
|
||||
/**
|
||||
* 内容区域触摸开始事件
|
||||
* @param e
|
||||
*/
|
||||
onContentTouchStart(e) {
|
||||
const focusedElement = document.activeElement;
|
||||
if (focusedElement) {
|
||||
focusedElement.blur();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动区域滚动事件
|
||||
* @param e
|
||||
@ -383,6 +394,7 @@ export default {
|
||||
ref: 'content',
|
||||
class: this.contentClass,
|
||||
on: {
|
||||
touchstart: this.onContentTouchStart,
|
||||
scroll: this.onContentScroll,
|
||||
mouseenter: this.onContentMouseenter,
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
</Input>
|
||||
</div>
|
||||
</div>
|
||||
<ul @scroll="operateVisible = false">
|
||||
<ul @touchstart="onTouchStart" @scroll="onScroll">
|
||||
<template v-if="projectLists.length === 0">
|
||||
<li v-if="projectKeyLoading > 0" class="loading"><Loading/></li>
|
||||
<li v-else class="nothing">
|
||||
@ -153,6 +153,17 @@ export default {
|
||||
this.goForward({name: 'manage-' + path, params: params || {}});
|
||||
},
|
||||
|
||||
onTouchStart(e) {
|
||||
const focusedElement = document.activeElement;
|
||||
if (focusedElement) {
|
||||
focusedElement.blur();
|
||||
}
|
||||
},
|
||||
|
||||
onScroll(e) {
|
||||
this.operateVisible = false
|
||||
},
|
||||
|
||||
modalPercent(item) {
|
||||
if (this.operateVisible) {
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user