Tiptap RTE: Fixes undo when RTE is emptied (#20133)
* Tiptap RTE: prevent `undefined` value If the `value` becomes `undefined`, then the block data can't be tracked (for undo/redo). The scenario comes when a user "selects all" contents, cuts it, and pasted it back in. Fixes #20076 * Tiptap RTE: fixes selection white text bug * Tiptap RTE: amends heading styles (for first-child)
This commit is contained in:
@@ -84,10 +84,6 @@ export class UmbRefRteBlockElement extends UmbLitElement {
|
||||
umb-icon,
|
||||
umb-ufm-render {
|
||||
z-index: 1;
|
||||
|
||||
&::selection {
|
||||
color: var(--uui-color-default-contrast);
|
||||
}
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
@@ -13,7 +13,11 @@ export default class UmbTiptapHeadingExtensionApi extends UmbTiptapExtensionApiB
|
||||
h5,
|
||||
h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5em;
|
||||
margin-bottom: 1rem;
|
||||
|
||||
&:first-child {
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -20,13 +20,6 @@ export class UmbPropertyEditorUiTiptapElement extends UmbPropertyEditorUiRteElem
|
||||
const tipTapElement = event.target;
|
||||
const markup = tipTapElement.value;
|
||||
|
||||
// If we don't get any markup clear the property editor value.
|
||||
if (tipTapElement.isEmpty()) {
|
||||
this.value = undefined;
|
||||
this._fireChangeEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove unused Blocks of Blocks Layout. Leaving only the Blocks that are present in Markup.
|
||||
const usedContentKeys: string[] = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user