-
Notifications
You must be signed in to change notification settings - Fork 1.3k
S2 taggroup collapse #6795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S2 taggroup collapse #6795
Conversation
bb3c904
to
ced16b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behavior looks good to me, but looks like there is a conflict with main.
# Conflicts: # packages/@react-spectrum/s2/src/TagGroup.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that if you expand the taggroup wide enough when there is a max rows set that the "collapse" button and the group action button disappear, digging
EDIT: Ah it makes sense that the collapse/expand button disappear but the group action button shouldn't
|
||
return { | ||
visibleTagCount: Math.max(index, 1), | ||
showCollapseButton: index < collection.size |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the Collapse/Expand button and the groupAction button are in the same group, this logic makes combined with tagState.visibleTagCount < collection.size
means that the groupAction button will be removed along side the collaspe/expand button if all the tags are visible.
Perhaps the group should always be rendered and showActions
should instead hide the expand/collapse button from inside the group?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed a fix
…m into s2-taggroup-collapse
…m into s2-taggroup-collapse
…m into s2-taggroup-collapse
…up-collapse # Conflicts: # packages/@react-spectrum/s2/src/TagGroup.tsx
## API Changes
@react-spectrum/s2TagGroup TagGroup <T extends {}> {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (T) => ReactNode
contextualHelp?: ReactNode
defaultSelectedKeys?: 'all' | Iterable<Key>
description?: ReactNode
disabledKeys?: Iterable<Key>
disallowEmptySelection?: boolean
errorMessage?: ReactNode
+ groupActionLabel?: string
id?: string
isEmphasized?: boolean
isInvalid?: boolean
items?: Iterable<T>
label?: ReactNode
labelAlign?: Alignment = 'start'
labelPosition?: LabelPosition = 'top'
+ maxRows?: number
+ onGroupAction?: () => void
onRemove?: (Set<Key>) => void
onSelectionChange?: (Selection) => void
renderEmptyState?: () => ReactNode
selectedKeys?: 'all' | Iterable<Key>
selectionMode?: SelectionMode
size?: 'S' | 'M' | 'L' = 'M'
slot?: string | null
styles?: StylesProp
} TagGroupProps TagGroupProps <T> {
UNSAFE_className?: string
UNSAFE_style?: CSSProperties
aria-describedby?: string
aria-details?: string
aria-label?: string
aria-labelledby?: string
children?: ReactNode | (T) => ReactNode
contextualHelp?: ReactNode
defaultSelectedKeys?: 'all' | Iterable<Key>
description?: ReactNode
disabledKeys?: Iterable<Key>
disallowEmptySelection?: boolean
errorMessage?: ReactNode
+ groupActionLabel?: string
id?: string
isEmphasized?: boolean
isInvalid?: boolean
items?: Iterable<T>
label?: ReactNode
labelAlign?: Alignment = 'start'
labelPosition?: LabelPosition = 'top'
+ maxRows?: number
+ onGroupAction?: () => void
onRemove?: (Set<Key>) => void
onSelectionChange?: (Selection) => void
renderEmptyState?: () => ReactNode
selectedKeys?: 'all' | Iterable<Key>
selectionMode?: SelectionMode
size?: 'S' | 'M' | 'L' = 'M'
slot?: string | null
styles?: StylesProp
} |
Closes
Added Taggroup Actions as well, it was pretty quick and small change
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: