Skip to content

Flex layout and character tokenizing don't interact as expected without whitespace #94

Description

@meisterz39

I'm using a button with a flex layout whose label is a comma delimited list of other labels. I've using the characters tokenize strategy, but the only way to get the word-wrap to correctly truncate the text is to include a whitespace between those labels. This seems to be due to the wordWrap: 'break-word' styling is applied regardless of tokenizing strategy (https://github.com/parsable/react-truncate-markup/blob/master/src/index.js#L322) whereas a 'characters' tokenizing strategy ought to use 'anywhere' instead.

To Reproduce
https://codesandbox.io/s/truncatemarkup-demo-z3zq4?file=/index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions