diff --git a/components/filter/index.axml b/components/filter/index.axml index 0e2bb00..190b0b9 100644 --- a/components/filter/index.axml +++ b/components/filter/index.axml @@ -1,5 +1,5 @@ - + diff --git a/components/filter/index.less b/components/filter/index.less index 82bbbcb..d84c9e2 100644 --- a/components/filter/index.less +++ b/components/filter/index.less @@ -14,10 +14,10 @@ top: 0; left: 0; right: 0; - bottom: 0; } &-mask { + bottom: 0; background: rgba(0, 0, 0, 0.65); } @@ -35,7 +35,7 @@ overflow-x: hidden; min-height: 200px; overflow-y: scroll; - max-height: 515px; + max-height: 415px; box-sizing: border-box; } diff --git a/components/filter/index.md b/components/filter/index.md index a8eee75..075525f 100644 --- a/components/filter/index.md +++ b/components/filter/index.md @@ -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 @@ -37,7 +38,7 @@ ``` ```html - + diff --git a/components/filter/index.ts b/components/filter/index.ts index dadaae8..f3ac96f 100644 --- a/components/filter/index.ts +++ b/components/filter/index.ts @@ -30,5 +30,10 @@ Component({ const { results } = this.data; onChange(results); }, + maskTap() { + if (this.props.onMaskTap) { + this.props.onMaskTap(); + } + }, }, }); diff --git a/components/search-bar/index.ts b/components/search-bar/index.ts index 686de81..3375cd1 100644 --- a/components/search-bar/index.ts +++ b/components/search-bar/index.ts @@ -40,6 +40,10 @@ Component({ // focus: true, // }); + setTimeout(() => { + this.handleFocus(); + }, 100); + if (!('value' in this.props)) { this.setData({ _value: '', diff --git a/examples/pages/filter/alternative/index.axml b/examples/pages/filter/alternative/index.axml index efb5cc9..7e3bcbe 100644 --- a/examples/pages/filter/alternative/index.axml +++ b/examples/pages/filter/alternative/index.axml @@ -1,4 +1,4 @@ - +