Skip to content

Commit b11369f

Browse files
committed
fix: half-screen-dialog scroll through
1 parent 9a584b7 commit b11369f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/half-screen-dialog/__test__/__snapshots__/half-screen-dialog.test.ts.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ exports[`grids basic 1`] = `
1313
class="weui-mask init"
1414
data-type="tap"
1515
bind:tap="close"
16+
catch:touchmove="onMaskMouseMove"
1617
/>
1718
<wx-view
1819
class="weui-half-screen-dialog "
@@ -101,6 +102,7 @@ exports[`grids basic 2`] = `
101102
class="weui-mask init"
102103
data-type="tap"
103104
bind:tap="close"
105+
catch:touchmove="onMaskMouseMove"
104106
/>
105107
<wx-view
106108
class="weui-half-screen-dialog "

src/half-screen-dialog/half-screen-dialog.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Component({
6666
buttonTap(e) {
6767
const { index } = e.currentTarget.dataset
6868
this.triggerEvent('buttontap', { index, item: this.data.buttons[index] }, {})
69+
},
70+
onMaskMouseMove(e) {
71+
// do nothing
6972
}
7073
}
7174
})

src/half-screen-dialog/half-screen-dialog.wxml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<view class="{{show ? 'weui-show' :'weui-hidden'}}">
2-
<view class="weui-mask init" wx:if="{{mask}}" bindtap="close" data-type="tap"></view>
1+
<view class="{{show ? 'weui-show' :'weui-hidden'}}">
2+
<view class="weui-mask init" wx:if="{{mask}}" bindtap="close" catch:touchmove="onMaskMouseMove" data-type="tap"></view>
33
<view class="weui-half-screen-dialog {{extClass}}">
44
<view class="weui-half-screen-dialog__hd">
55
<view wx:if="{{closabled}}" class="weui-half-screen-dialog__hd__side" bindtap="close" data-type="close">
@@ -27,12 +27,12 @@
2727
</view>
2828
<view class="weui-half-screen-dialog__ft">
2929
<block wx:if="{{buttons && buttons.length}}">
30-
<button
31-
wx:for="{{buttons}}"
30+
<button
31+
wx:for="{{buttons}}"
3232
wx:key="index"
33-
type="{{item.type}}"
34-
class="weui-btn {{item.className}}"
35-
data-index="{{index}}"
33+
type="{{item.type}}"
34+
class="weui-btn {{item.className}}"
35+
data-index="{{index}}"
3636
bindtap="buttonTap"
3737
>{{item.text}}</button>
3838
</block>

0 commit comments

Comments
 (0)