Skip to content

Commit

Permalink
Merge pull request #301 from ant-mini-program/verion/0.4.34
Browse files Browse the repository at this point in the history
Verion/0.4.34
  • Loading branch information
oimz1989 authored Sep 24, 2019
2 parents 932d485 + 356771b commit 2c4f1fa
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/filter/index.axml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<view class="am-filter-{{show ? 'show' : 'hide'}} {{className}}" disable-scroll="{{false}}">
<view class="am-filter-mask" />
<view class="am-filter-mask" onTap="maskTap" />
<view class="am-filter-document">
<view class="am-filter-content" onChange="{{callBackFn}}">
<view class="am-filter-list">
Expand Down
4 changes: 2 additions & 2 deletions components/filter/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
top: 0;
left: 0;
right: 0;
bottom: 0;
}

&-mask {
bottom: 0;
background: rgba(0, 0, 0, 0.65);
}

Expand All @@ -35,7 +35,7 @@
overflow-x: hidden;
min-height: 200px;
overflow-y: scroll;
max-height: 515px;
max-height: 415px;
box-sizing: border-box;
}

Expand Down
3 changes: 2 additions & 1 deletion components/filter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| show | 是否显示 可选值 `show` `hide` | String | hide | false |
| max | 可选数量最大值,1为单选 | Number | 10000 | false |
| onChange | 多选时提交选中回调 | (e: Object) => void | | false |
| onMaskTap | 点击遮罩层时触发,可用于关闭 filter | () => void | | false |

## filter-item

Expand All @@ -37,7 +38,7 @@
```

```html
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack">
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack" onMaskTap="toggleFilter">
<block a:for="{{items}}">
<filter-item value="{{item.value}}" id="{{item.id}}" selected="{{item.selected}}"/>
</block>
Expand Down
5 changes: 5 additions & 0 deletions components/filter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ Component({
const { results } = this.data;
onChange(results);
},
maskTap() {
if (this.props.onMaskTap) {
this.props.onMaskTap();
}
},
},
});
4 changes: 4 additions & 0 deletions components/search-bar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ Component({
// focus: true,
// });

setTimeout(() => {
this.handleFocus();
}, 100);

if (!('value' in this.props)) {
this.setData({
_value: '',
Expand Down
2 changes: 1 addition & 1 deletion examples/pages/filter/alternative/index.axml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack">
<filter show="{{show}}" max="{{5}}" onChange="handleCallBack" onMaskTap="toggleFilter">
<block a:for="{{items}}">
<filter-item value="{{item.value}}" id="{{item.id}}" selected="{{item.selected}}" key="filter-item-{{index}}" />
</block>
Expand Down

0 comments on commit 2c4f1fa

Please sign in to comment.