mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 09:25:29 +08:00
revert: "fix(vue-3): fix editor.state updating too late during a transaction due to reactiveState fixes #4870 (#5252)"
This reverts commit 509676ed4a
.
This commit is contained in:
parent
0879c7df7d
commit
dbab8e42ea
@ -406,11 +406,6 @@ export class Editor extends EventEmitter<EditorEvents> {
|
||||
const state = this.state.apply(transaction)
|
||||
const selectionHasChanged = !this.state.selection.eq(state.selection)
|
||||
|
||||
this.emit('beforeTransaction', {
|
||||
editor: this,
|
||||
transaction,
|
||||
nextState: state,
|
||||
})
|
||||
this.view.updateState(state)
|
||||
this.emit('transaction', {
|
||||
editor: this,
|
||||
|
@ -50,7 +50,6 @@ export interface EditorEvents {
|
||||
}
|
||||
update: { editor: Editor; transaction: Transaction }
|
||||
selectionUpdate: { editor: Editor; transaction: Transaction }
|
||||
beforeTransaction: { editor: Editor; transaction: Transaction, nextState: EditorState }
|
||||
transaction: { editor: Editor; transaction: Transaction }
|
||||
focus: { editor: Editor; event: FocusEvent; transaction: Transaction }
|
||||
blur: { editor: Editor; event: FocusEvent; transaction: Transaction }
|
||||
|
@ -50,8 +50,8 @@ export class Editor extends CoreEditor {
|
||||
this.reactiveState = useDebouncedRef(this.view.state)
|
||||
this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage)
|
||||
|
||||
this.on('beforeTransaction', ({ nextState }) => {
|
||||
this.reactiveState.value = nextState
|
||||
this.on('transaction', () => {
|
||||
this.reactiveState.value = this.view.state
|
||||
this.reactiveExtensionStorage.value = this.extensionStorage
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user