fix(escort): 医院下拉在弹窗内滚动定位,避免列表被裁切

This commit is contained in:
lik
2026-11-06 17:29:46 +08:00
parent 3f7adbda80
commit c6a8da0683
+6
View File
@@ -33,6 +33,9 @@ Component({
placeholder: { type: String, value: '请选择就诊医院' },
disabled: { type: Boolean, value: false },
compact: { type: Boolean, value: false },
// 默认由组件自己上滚页面;放在弹窗内的 scroll-view 时,
// 页面滚动无法带动弹窗内容,需置 false 交给页面做容器内滚动
autoPageScroll: { type: Boolean, value: true },
// 展开面板上滚时,医院行锚定到距页面顶部的距离(rpx);
// 传入上方行的总高度,可让「就诊人姓名」等上一行滚到页面顶部
scrollAnchorOffset: { type: Number, value: 0 },
@@ -72,6 +75,9 @@ Component({
}
this.setData({ open: true, keyword: '', manualEntry: false })
this.refreshFiltered(this.data.options, '')
// 页面可监听 open 事件,在自定义滚动容器内做定位
this.triggerEvent('open')
if (!this.data.autoPageScroll) return
// 面板展开后若被页面底部遮挡,自动上滚页面,保证下拉列表完整可见
wx.nextTick(() => this.scrollPanelIntoView())
},