Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions src/shared/ui/Items/SelectBase/SelectBaseText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Props = {

export const SelectBaseText = (props: Props) => {
const { processedWords } = useCustomWordWrap(props.text);
const hasLongWord = processedWords.some(({ needsWrap }) => needsWrap);

return (
<Text
Expand All @@ -22,23 +23,21 @@ export const SelectBaseText = (props: Props) => {
cursor: 'pointer',
lineBreak: 'normal',
display: '-webkit-box',

// Using kebab-case (i.e. `-webkit-some-things`) would cause warnings
// in the JS console about kebab-case being not supported for CSS
// properties.
Comment thread
sricharan-varanasi marked this conversation as resolved.
webkitLineClamp: '3',
webkitBoxOrient: 'vertical',
}}
>
{processedWords.map(({ word, needsWrap, ref }, index) => {
return needsWrap ? (
<span ref={ref} style={{ wordBreak: 'break-word' }} key={index}>
{`${word} `}
</span>
) : (
`${word} `
);
})}
{hasLongWord
? processedWords.map(({ word, needsWrap, ref }, index) =>
needsWrap ? (
<span ref={ref} style={{ wordBreak: 'break-word' }} key={index}>
{`${word} `}
</span>
) : (
`${word} `
),
)
: props.text}
</Text>
);
};