Skip to content

Commit 97710c2

Browse files
authored
fix: Truncated text in InplaceTextEditor [FC-0090] (#2146)
* Fix the truncated text in InplaceTextEditor. * Fix the truncated text in the breadcrumbs in the subsection page
1 parent b510b6f commit 97710c2

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.inplace-text-editor-label {
2+
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
3+
-webkit-line-clamp: 1;
4+
-webkit-box-orient: vertical;
5+
overflow: hidden;
6+
}

src/generic/inplace-text-editor/index.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
Form,
77
Icon,
88
IconButton,
9-
Truncate,
109
Stack,
1110
} from '@openedx/paragon';
1211
import { Edit } from '@openedx/paragon/icons';
@@ -69,9 +68,9 @@ export const InplaceTextEditor: React.FC<InplaceTextEditorProps> = ({
6968
// In that case, we show the new text instead of the original in read-only mode as an optimistic update.
7069
if (readOnly || pendingSaveText) {
7170
return (
72-
<Truncate.Deprecated className={textClassName}>
71+
<div className={`inplace-text-editor-label ${textClassName}`}>
7372
{pendingSaveText || text}
74-
</Truncate.Deprecated>
73+
</div>
7574
);
7675
}
7776

@@ -93,9 +92,9 @@ export const InplaceTextEditor: React.FC<InplaceTextEditorProps> = ({
9392
)
9493
: (
9594
<>
96-
<Truncate.Deprecated className={textClassName}>
95+
<div className={`inplace-text-editor-label ${textClassName}`}>
9796
{text}
98-
</Truncate.Deprecated>
97+
</div>
9998
<IconButton
10099
src={Edit}
101100
iconAs={Icon}

src/generic/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
@import "./block-type-utils";
1515
@import "./modal-iframe";
1616
@import "./alert-message";
17+
@import "./inplace-text-editor/InplaceTextEditor";

src/library-authoring/section-subsections/LibrarySubsectionPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface OverflowLinksProps {
2828
const OverflowLinks = ({ children, to }: OverflowLinksProps) => {
2929
if (typeof to === 'string') {
3030
return (
31-
<Link className="link-muted" to={to}>
31+
<Link className="subsection-breadcrumb link-muted" to={to}>
3232
{children}
3333
</Link>
3434
);

src/library-authoring/section-subsections/index.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,11 @@
3636
padding: 0;
3737
}
3838
}
39+
40+
.subsection-breadcrumb {
41+
max-width: 700px;
42+
display: inline-block;
43+
white-space: nowrap;
44+
overflow: hidden;
45+
text-overflow: ellipsis;
46+
}

0 commit comments

Comments
 (0)