Skip to content

TextInput + isLeftTruncated prop: Use resizeObserver to trigger trimLeft calculation #4710

Description

@jschuler

If the TextInput has the isLeftTruncated prop set to true, if other page elements like the sidebar push on the input and change the dimensions, then the recalculation for trimming the text won’t happen.
You can see this happen when you size the window down so that there is no sidebar, then slowly increase the width of the window until the sidebar pops in
https://patternfly-react-pr-4691.surge.sh/documentation/react/components/textinput

if we had a resizeObserver and listened to the input box dimension changes instead of only window resize, we wouldn’t have this issue

Consider making a general purpose resizeObserver utility that we can use in other components as well if needed

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions