Skip to content

Commit

Permalink
fix(pro:search): rest count should hide when no item is overflowed
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Nov 6, 2023
1 parent 873d214 commit 8938747
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/pro/search/src/ProSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ export default defineComponent({
rest: (rest: (SearchItem | typeof nameSelectOverflowItemKey)[]) => {
const restItems = rest.filter(item => item !== nameSelectOverflowItemKey)

if (!restItems.length) {
return
}

return (
<span class={`${prefixCls}-search-item ${prefixCls}-search-item-tag`}>
{slots.overflowedLabel?.(restItems) ?? `+ ${restItems.length}`}
Expand Down

0 comments on commit 8938747

Please sign in to comment.