Skip to content

Commit 2c4f1fa

Browse files
authored
Merge pull request #301 from ant-mini-program/verion/0.4.34
Verion/0.4.34
2 parents 932d485 + 356771b commit 2c4f1fa

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

components/filter/index.axml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<view class="am-filter-{{show ? 'show' : 'hide'}} {{className}}" disable-scroll="{{false}}">
2-
<view class="am-filter-mask" />
2+
<view class="am-filter-mask" onTap="maskTap" />
33
<view class="am-filter-document">
44
<view class="am-filter-content" onChange="{{callBackFn}}">
55
<view class="am-filter-list">

components/filter/index.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
top: 0;
1515
left: 0;
1616
right: 0;
17-
bottom: 0;
1817
}
1918

2019
&-mask {
20+
bottom: 0;
2121
background: rgba(0, 0, 0, 0.65);
2222
}
2323

@@ -35,7 +35,7 @@
3535
overflow-x: hidden;
3636
min-height: 200px;
3737
overflow-y: scroll;
38-
max-height: 515px;
38+
max-height: 415px;
3939
box-sizing: border-box;
4040
}
4141

components/filter/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
| show | 是否显示 可选值 `show` `hide` | String | hide | false |
1414
| max | 可选数量最大值,1为单选 | Number | 10000 | false |
1515
| onChange | 多选时提交选中回调 | (e: Object) => void | | false |
16+
| onMaskTap | 点击遮罩层时触发,可用于关闭 filter | () => void | | false |
1617

1718
## filter-item
1819

@@ -37,7 +38,7 @@
3738
```
3839

3940
```html
40-
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack">
41+
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack" onMaskTap="toggleFilter">
4142
<block a:for="{{items}}">
4243
<filter-item value="{{item.value}}" id="{{item.id}}" selected="{{item.selected}}"/>
4344
</block>

components/filter/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@ Component({
3030
const { results } = this.data;
3131
onChange(results);
3232
},
33+
maskTap() {
34+
if (this.props.onMaskTap) {
35+
this.props.onMaskTap();
36+
}
37+
},
3338
},
3439
});

components/search-bar/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ Component({
4040
// focus: true,
4141
// });
4242

43+
setTimeout(() => {
44+
this.handleFocus();
45+
}, 100);
46+
4347
if (!('value' in this.props)) {
4448
this.setData({
4549
_value: '',

examples/pages/filter/alternative/index.axml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack">
1+
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack" onMaskTap="toggleFilter">
22
<block a:for="{{items}}">
33
<filter-item value="{{item.value}}" id="{{item.id}}" selected="{{item.selected}}" key="filter-item-{{index}}" />
44
</block>

0 commit comments

Comments
 (0)