Ensure that the visual editor recognises a "drop" event as a "mouseup" (#19560)

GitOrigin-RevId: 967d3c80a1501ffdfe9a7e3e978cba746a54d7b3
This commit is contained in:
Alf Eaton 2024-07-29 13:30:16 +01:00 committed by Copybot
parent 21e458df2a
commit 4af10054df

View file

@ -107,6 +107,14 @@ const mouseDownListener = EditorView.domEventHandlers({
})
})
},
drop: (event: MouseEvent, view) => {
// treat a `drop` event as a `mouseup` event, which isn't fired
window.setTimeout(() => {
view.dispatch({
effects: mouseDownEffect.of(false),
})
})
},
})
const mousedownSelectionState = StateField.define<EditorSelection | undefined>({