Skip to content

TagGroup: add maxRows prop to limit initially shown tags, and include 'Show all' button#3759

Merged
reidbarber merged 54 commits into
mainfrom
tagroup-show-all
Jan 13, 2023
Merged

TagGroup: add maxRows prop to limit initially shown tags, and include 'Show all' button#3759
reidbarber merged 54 commits into
mainfrom
tagroup-show-all

Conversation

@reidbarber
Copy link
Copy Markdown
Member

@reidbarber reidbarber commented Nov 16, 2022

Closes #3660

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Check maxRows stories under TagGroup. Resize container and confirm behavior.

🧢 Your Project:

RSP

@adobe-bot
Copy link
Copy Markdown

@reidbarber reidbarber changed the title WIP: TagGroup: add defaultVisibleRows prop to limit initially shown tags, and include 'Show all' button WIP: TagGroup: add maxRows prop to limit initially shown tags, and include 'Show all' button Nov 16, 2022
@adobe adobe deleted a comment from adobe-bot Nov 16, 2022
@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

@adobe adobe deleted a comment from adobe-bot Nov 17, 2022
@adobe-bot
Copy link
Copy Markdown

@adobe-bot
Copy link
Copy Markdown

@reidbarber reidbarber changed the title WIP: TagGroup: add maxRows prop to limit initially shown tags, and include 'Show all' button TagGroup: add maxRows prop to limit initially shown tags, and include 'Show all' button Dec 6, 2022
@adobe-bot
Copy link
Copy Markdown

@adobe adobe deleted a comment from adobe-bot Dec 6, 2022
@adobe-bot
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/@react-spectrum/tag/test/TagGroup.test.js
Comment thread packages/@react-spectrum/tag/src/TagGroup.tsx Outdated
Comment thread packages/@react-spectrum/tag/src/TagGroup.tsx Outdated
Comment thread packages/@react-spectrum/tag/src/TagGroup.tsx Outdated
@devongovett
Copy link
Copy Markdown
Member

Seems like when you make the width bigger, it doesn't display more tags now?

@reidbarber
Copy link
Copy Markdown
Member Author

Seems like when you make the width bigger, it doesn't display more tags now?

@devongovett If you refresh, it behaves correctly. Looking into why it's different on first load....

@devongovett
Copy link
Copy Markdown
Member

Hmm I tried refreshing and it still happened for me. Actually when I make the element smaller, it also wraps to show more than 2 lines:
image

@reidbarber
Copy link
Copy Markdown
Member Author

@devongovett Yeah, looks like the new inline styles I introduced broke the overflow logic. Working on it now.

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 12, 2023

@reidbarber
Copy link
Copy Markdown
Member Author

Should be fixed now. One issue was with font loading, and I needed to set the resize observer to watch the new container. Also went ahead and added in translation strings for the button.

Copy link
Copy Markdown
Member

@devongovett devongovett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working well for me in Safari.

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 12, 2023

1 similar comment
@rspbot
Copy link
Copy Markdown

rspbot commented Jan 13, 2023

@adobe adobe deleted a comment from adobe-bot Jan 13, 2023
@rspbot
Copy link
Copy Markdown

rspbot commented Jan 13, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 13, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

@react-aria/tag

AriaTagGroupProps

-
+AriaTagGroupProps<T> {
+  keyboardDelegate?: TagKeyboardDelegate<T>
+}

it changed:

  • useTagGroup

@react-spectrum/tag

Item

 SpectrumTagGroupProps<T> {
-  allowsRemoving?: boolean
-  onRemove?: (Key) => void
+
 }

SpectrumTagGroupProps

+TagGroup<T extends {}> {
 
+}

Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working well for me in Chrome and on iPhone Safari

@reidbarber reidbarber merged commit 1faa59e into main Jan 13, 2023
@reidbarber reidbarber deleted the tagroup-show-all branch January 13, 2023 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TagGroup: Limit the number of tags/size that tag takes to render

7 participants