Skip to content

Commit

Permalink
* picker: fix maxItemsCount not work with search.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed May 17, 2024
1 parent dbd591b commit 37c9d4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/picker/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ onPageUpdate(() => {
placeholder: '请选择你的最爱',
searchHint: '搜索选项',
cache: false,
maxItemsCount: 4,
});
console.log('> singlePickerRemote', singlePickerRemote);

Expand Down
2 changes: 1 addition & 1 deletion lib/picker/dev/items.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{"text": "Dog", "value": "dog", "keys": "animals pet"},
{"text": "Fish", "value": "fish", "keys": "animals food"},
{"text": "Pig", "value": "pig", "keys": "animals food"},
{"text": "梨子", "value": "pear", "keys": "fruit food"},
{"text": "梨子", "value": "pear", "keys": "fruit food lizi"},
{"text": "Anna", "value": "anna", "keys": "human animals"},
{"text": "Ben", "value": "ben", "keys": "human animals"},
{"text": "Cake", "value": "cake", "keys": "food"}
Expand Down
3 changes: 2 additions & 1 deletion lib/picker/src/component/picker-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export class PickerMenu extends PickPop<PickerState, PickerMenuProps> {
ref: this._menu,
className: 'picker-menu-list',
underlineKeys: true,
items: maxItemsCount ? items.slice(0, maxItemsCount) : items,
limit: maxItemsCount,
items: items,
defaultNestedShow: true,
activeOnHover: true,
search: search,
Expand Down

0 comments on commit 37c9d4c

Please sign in to comment.