Skip to content

Commit

Permalink
Fix an issue breaking in-place updates for non-inclusive block widgets
Browse files Browse the repository at this point in the history
FIX: Fix an issue that prevented non-inclusive block widgets from having their
`updateDOM` method called when changed.

See https://discuss.codemirror.net/t/updating-block-widgets-what-is-the-order-of-the-state-update-cycle-exactly/8365
  • Loading branch information
marijnh committed Jun 21, 2024
1 parent a943e6c commit f242f4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/blockview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ export class LineView extends ContentView implements BlockView {
return rect
}

become(_other: ContentView) { return false }
become(other: ContentView) {
return other instanceof LineView && this.children.length == 0 && other.children.length == 0 &&
attrsEq(this.attrs, other.attrs) && this.breakAfter == other.breakAfter
}

covers() { return true }

Expand Down

0 comments on commit f242f4b

Please sign in to comment.