Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lexical][lexical-table] Bug Fix: Allow TableSelection to be preserved during contextmenu events #6964

Merged
merged 5 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading