Skip to content

Commit

Permalink
Fix case when deleting across blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mlshapiro committed Dec 28, 2023
1 parent 9e68f54 commit 1373e9e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/editor/block/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,12 @@ const updateTimeOnChange = EditorState.transactionFilter.of((tr) => {

const state = tr.startState
const block = getActiveNoteBlock(state)
const updatedTime = newUpdatedTime()

// Block updates to time when deleting the last content in a block
if ((block.content.from === block.content.to) && !tr.changes.inserted.length) return tr

// this adds a slight debounce so the delimiter is only updated every second
const updatedTime = newUpdatedTime()
if (block.time.updated === updatedTime) return tr

const language = block.language.name
Expand Down

0 comments on commit 1373e9e

Please sign in to comment.