feat(Truncate): Add true calculated middle truncate#11638
Closed
mfrances17 wants to merge 1 commit intopatternfly:mainfrom
Closed
feat(Truncate): Add true calculated middle truncate#11638mfrances17 wants to merge 1 commit intopatternfly:mainfrom
mfrances17 wants to merge 1 commit intopatternfly:mainfrom
Conversation
Collaborator
|
Preview: https://patternfly-react-pr-11638.surge.sh A11y report: https://patternfly-react-pr-11638-a11y.surge.sh |
Contributor
thatblindgeye
left a comment
There was a problem hiding this comment.
Might be noticing some odd behavior.
- When I pass a string of 40 characters (
xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxX), I was expecting to have the same amount of characters in either side of the ellipsis, but I end up with 18 before the ellipsis and 20 after. - Before the truncation occurs, there's a large white space that slowly shrinks as more characters are added. Screenshot when only 4 characters are present:

- Not sure if there's a better solution, but not 100% on having
trailingNumCharsof 0 acting as the trigger to apply the true middle truncation. Possibly updating the type of the prop to number or "auto", but the auto would really only take affect for middle truncation. A new position value of "auto-middle" maybe. This isn't really a blocker for me, but might be good to discuss before we're locked into the logic.
Contributor
|
I'm a little confused how this is supposed to behave overall. In the updated example, if you change the string to longer text, or resize the text area, the ellipsis in the middle will still shift to the left. It calculates the middle of the content but otherwise behaves the same as trailing number of characters. Is this the intended pattern opposed to trying to keep the ellipsis centered? |
Contributor
|
Closing for now as we merged #11742 as another implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Closes #10892
This will add a true middle truncate if middle truncate is chosen and a value of 0 is passed for the trailing chars.