Skip to content

Commit

Permalink
Ensure deletions capture existing formatting (#3867)
Browse files Browse the repository at this point in the history
  • Loading branch information
trueadm authored Feb 9, 2023
1 parent 1e53523 commit 499bc16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/lexical/src/LexicalSelection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,11 @@ export class RangeSelection implements BaseSelection {
anchorNode.collapseAtStart(this);
}
}
const anchorNode = this.anchor.getNode();
if ($isTextNode(anchorNode)) {
this.format = anchorNode.getFormat();
this.style = anchorNode.getStyle();
}
}

deleteLine(isBackward: boolean): void {
Expand Down

2 comments on commit 499bc16

@vercel
Copy link

@vercel vercel bot commented on 499bc16 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical-git-main-fbopensource.vercel.app
www.lexical.dev
lexical-fbopensource.vercel.app
lexicaljs.com
lexicaljs.org
lexical.dev

@vercel
Copy link

@vercel vercel bot commented on 499bc16 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-fbopensource.vercel.app
lexical-playground.vercel.app
lexical-playground-git-main-fbopensource.vercel.app
playground.lexical.dev

Please sign in to comment.