Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions packages/eui/changelogs/upcoming/9063.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Updated `EuiComboBox` to properly break long strings without spaces when `rowHeight="auto"`
8 changes: 0 additions & 8 deletions packages/eui/src/components/combo_box/combo_box.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { EuiFlexItem } from '../flex';

import { EuiComboBoxOptionMatcher } from './types';
import { EuiComboBox, EuiComboBoxProps } from './combo_box';
import { EuiHighlight } from '../highlight';

const options = [
{ label: 'Item 1' },
Expand Down Expand Up @@ -163,13 +162,6 @@ export const RowHeightAuto: Story = {
},
{ label: 'elastic.task_manager_metrics.metrics.task_claim.value.total' },
],
renderOption: (option, searchValue) => {
return (
<EuiHighlight search={searchValue} style={{ wordBreak: 'break-word' }}>
{option.label}
</EuiHighlight>
);
},
},
render: (args) => <StatefulComboBox {...args} />,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const euiComboBoxOptionListStyles = (euiThemeContext: UseEuiTheme) => {
.euiComboBoxOption__content {
flex: 1;
text-align: start;
/* Allow long strings without spaces to break,
while keeping regular sentences wrapping as expected */
overflow-wrap: anywhere;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call! And it's widely enough supported 🎉

}

.euiComboBoxOption__emptyStateText {
Expand Down