Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions src/generic/inplace-text-editor/InplaceTextEditor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.inplace-text-editor-label {
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
overflow: hidden;
}
9 changes: 4 additions & 5 deletions src/generic/inplace-text-editor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Form,
Icon,
IconButton,
Truncate,
Stack,
} from '@openedx/paragon';
import { Edit } from '@openedx/paragon/icons';
Expand Down Expand Up @@ -69,9 +68,9 @@ export const InplaceTextEditor: React.FC<InplaceTextEditorProps> = ({
// In that case, we show the new text instead of the original in read-only mode as an optimistic update.
if (readOnly || pendingSaveText) {
return (
<Truncate className={textClassName}>
<div className={`inplace-text-editor-label ${textClassName}`}>
{pendingSaveText || text}
</Truncate>
</div>
);
}

Expand All @@ -93,9 +92,9 @@ export const InplaceTextEditor: React.FC<InplaceTextEditorProps> = ({
)
: (
<>
<Truncate className={textClassName}>
<div className={`inplace-text-editor-label ${textClassName}`}>
{text}
</Truncate>
</div>
<IconButton
src={Edit}
iconAs={Icon}
Expand Down
1 change: 1 addition & 0 deletions src/generic/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
@import "./block-type-utils";
@import "./modal-iframe";
@import "./alert-message";
@import "./inplace-text-editor/InplaceTextEditor";