Skip to content

Commit

Permalink
fix(components,-protocol-designer): fix word break in dropdown menu
Browse files Browse the repository at this point in the history
This PR fixes word break style for dropdown menu-- should break at word.

Closes RQA-3950
  • Loading branch information
ncdiehl11 committed Feb 6, 2025
1 parent 09e127d commit 2294fa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/src/molecules/DropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {
>
<StyledText
desktopStyle="captionRegular"
css={LINE_CLAMP_TEXT_STYLE(3)}
css={LINE_CLAMP_TEXT_STYLE(3, true)}
>
{option.name}
</StyledText>
Expand Down Expand Up @@ -369,15 +369,15 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element {

export const LINE_CLAMP_TEXT_STYLE = (
lineClamp?: number,
title?: boolean
wordBreak?: boolean
): FlattenSimpleInterpolation => css`
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: ${OVERFLOW_HIDDEN};
text-overflow: ellipsis;
word-wrap: break-word;
-webkit-line-clamp: ${lineClamp ?? 1};
word-break: ${title === true
word-break: ${wordBreak === true
? 'normal'
: 'break-all'}; // normal for tile and break-all for a non word case like aaaaaaaa
`
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function DropdownStepFormField(
>
<StyledText
desktopStyle="captionRegular"
css={LINE_CLAMP_TEXT_STYLE(3)}
css={LINE_CLAMP_TEXT_STYLE(3, true)}
>
{options[0].name}
</StyledText>
Expand Down

0 comments on commit 2294fa7

Please sign in to comment.