Skip to content

Commit 1db0743

Browse files
fix(compass-components): prevent document keys from getting ellipsized on safari COMPASS-7377 (#5344)
fix: prevent document keys from getting ellipsed on safari
1 parent beb07e9 commit 1db0743

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/compass-components/src/components/document-list/element-editors.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export const KeyEditor: React.FunctionComponent<{
6969
onEditStart,
7070
}) => {
7171
const darkMode = useDarkMode();
72-
const width = `${Math.max(value.length, 1)}ch`;
72+
// On Safari if a text is 5 mono-characters wide and is supposed to overflow /
73+
// get ellipse'd only when shorter than that, it would still overflow and get
74+
// ellipse'd under normal conditions, for unknown reasons. For that, we add a
75+
// small amount to the width to tackle this issue.
76+
const width = `${Math.max(value.length, 1)}.5ch`;
7377

7478
return (
7579
<>

0 commit comments

Comments
 (0)