Skip to content

Commit

Permalink
[lexical][lexical-table] Bug Fix: Allow TableSelection to be preserve…
Browse files Browse the repository at this point in the history
…d during contextmenu events (#6964)
  • Loading branch information
etrepum authored Dec 14, 2024
1 parent b8bd3bb commit 26c6f26
Show file tree
Hide file tree
Showing 34 changed files with 366 additions and 180 deletions.
3 changes: 2 additions & 1 deletion examples/react-rich/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
DOMConversionMap,
DOMExportOutput,
DOMExportOutputMap,
isHTMLElement,
Klass,
LexicalEditor,
LexicalNode,
Expand All @@ -36,7 +37,7 @@ const removeStylesExportDOM = (
target: LexicalNode,
): DOMExportOutput => {
const output = target.exportDOM(editor);
if (output && output.element instanceof HTMLElement) {
if (output && isHTMLElement(output.element)) {
// Remove all inline styles and classes if the element is an HTMLElement
// Children are checked as well since TextNode can be nested
// in i, b, and strong tags.
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-link/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class LinkNode extends ElementNode {
anchor: LinkHTMLElementType,
config: EditorConfig,
): boolean {
if (anchor instanceof HTMLAnchorElement) {
if (isHTMLAnchorElement(anchor)) {
const url = this.__url;
const target = this.__target;
const rel = this.__rel;
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical-list/src/LexicalListNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class ListNode extends ElementNode {

exportDOM(editor: LexicalEditor): DOMExportOutput {
const element = this.createDOM(editor._config, editor);
if (element && isHTMLElement(element)) {
if (isHTMLElement(element)) {
if (this.__start !== 1) {
element.setAttribute('start', String(this.__start));
}
Expand Down
Loading

0 comments on commit 26c6f26

Please sign in to comment.