Skip to content

fix: allow user override of internal ThProps#596

Merged
nicolethoen merged 2 commits intopatternfly:mainfrom
kmcfaul:th-props-fix
Feb 5, 2026
Merged

fix: allow user override of internal ThProps#596
nicolethoen merged 2 commits intopatternfly:mainfrom
kmcfaul:th-props-fix

Conversation

@kmcfaul
Copy link
Contributor

@kmcfaul kmcfaul commented Jan 29, 2026

Closes #576.

Allows user set modifier, className, style props which were being ignored.
Cleans up some prop descriptions for resizable props.

I was unable to reproduce the issue where width props were being ignored, both the th props:width and resizableProps:width function normally.

@patternfly-build
Copy link

patternfly-build commented Jan 29, 2026

@karelhala karelhala self-requested a review January 30, 2026 15:12
@nicolethoen nicolethoen self-requested a review January 30, 2026 15:33
Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

One question

ref={thRef}
modifier="truncate"
className={dataViewThClassName}
style={width > 0 ? { minWidth: width, ...thProps?.style } : thProps?.style}
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume the minWidth here is important for the resizing feature. Is it possible that someone could inadvertently break the resize feature if they set thProps?.style? maybe the minWidth should be after the spreading of thProps.style so that the resize feature will keep working?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was debating that when I was reordering other props, and I'll go ahead and swap the order because the resize would break since a style prop would always override the internal minWidth. It should be uncommon for a user to directly modify minWidth via style since there are two width options in the props they can modify.

@nicolethoen nicolethoen self-requested a review February 3, 2026 19:25
@nicolethoen nicolethoen merged commit f77fddd into patternfly:main Feb 5, 2026
9 checks passed
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🎉 This PR is included in version 6.4.0-prerelease.12 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Column headers always truncate

3 participants