-
Notifications
You must be signed in to change notification settings - Fork 536
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
TreeView: Add truncate
prop
#5122
Conversation
🦋 Changeset detectedLatest commit: 19e2ac9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
🟢 golden-jobs completed with status |
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/348023 |
111509e
to
ffe6535
Compare
truncate
prop
@@ -282,6 +289,7 @@ const Root: React.FC<TreeViewProps> = ({ | |||
'aria-labelledby': ariaLabelledby, | |||
children, | |||
flat, | |||
truncate = true, |
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.
@TylerJDev do you think it might make more sense to make this false by default? Just wondering if this is kind of a breaking change. Have you run an integration test?
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.
For this, I set it to true
to keep the default behavior of the text truncating when not using the prop. When using it with false
, it will wrap instead. The new behavior should only be opt-in, so that we can release this under a non breaking change.
Let me know if you think we should change the prop name (e.g. shouldNotTruncate
, wrap
). Not sure if truncate
is confusing or not 😅
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.
OH sorry I totally read the CSS wrong. Awesome! 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.
🚀
Updated snapshots for storybook story changes! |
Context https://github.com/github/primer/issues/3481
Adds
truncate
prop toTreeView
. There currently isn't a way to wrap text insideTreeView.Item
without doing it manually. This adds a prop which allows you to add this behavior directly via the prop, instead of doing it manually through custom styles.Changelog
New
truncate
prop toTreeView
Rollout strategy
Testing & Reviewing
Merge checklist