fix(index): 修复选预设时长时页面向上跳动
input 聚焦键盘弹起时点预设,onSelectPreset 清空 customInput 触发 adjust-position 重算导致页面上跳。点预设时先失焦 input 收键盘。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,7 @@ Page({
|
||||
planTotal: 7,
|
||||
planProgress: 0,
|
||||
showPicker: false,
|
||||
pickerInputFocus: false,
|
||||
presets: [30, 60, 90, 120, 180, 300],
|
||||
customDuration: 60,
|
||||
customInput: '',
|
||||
@@ -170,7 +171,12 @@ Page({
|
||||
|
||||
onSelectPreset(e) {
|
||||
const val = e.currentTarget.dataset.value
|
||||
this.setData({ customDuration: val, customInput: '' })
|
||||
// 收起键盘(失焦 input),避免清空 customInput 时触发 adjust-position 让页面向上跳
|
||||
this.setData({ pickerInputFocus: false, customDuration: val, customInput: '' })
|
||||
},
|
||||
|
||||
onPickerInputFocus() {
|
||||
this.setData({ pickerInputFocus: true })
|
||||
},
|
||||
|
||||
onCustomInput(e) {
|
||||
|
||||
Reference in New Issue
Block a user