mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 17:00:31 +08:00
fix: #3080 "BackSpace" shoutcut on a selected image deletes the whole line
Reverted unnecessary modification code.
This commit is contained in:
parent
c0ea0bdd3c
commit
75aed2beef
@ -103,11 +103,9 @@ const backspaceCtrl = ContentState => {
|
||||
|
||||
ContentState.prototype.docBackspaceHandler = function (event) {
|
||||
// handle delete selected image
|
||||
const { selectedImage } = this
|
||||
if (selectedImage) {
|
||||
if (this.selectedImage) {
|
||||
event.preventDefault()
|
||||
this.selectedImage = null
|
||||
return this.deleteImage(selectedImage)
|
||||
return this.deleteImage(this.selectedImage)
|
||||
}
|
||||
if (this.selectedTableCells) {
|
||||
event.preventDefault()
|
||||
@ -117,17 +115,15 @@ const backspaceCtrl = ContentState => {
|
||||
|
||||
ContentState.prototype.backspaceHandler = function (event) {
|
||||
const { start, end } = selection.getCursorRange()
|
||||
const { selectedImage } = this
|
||||
|
||||
if (!start || !end) {
|
||||
return
|
||||
}
|
||||
|
||||
// handle delete selected image
|
||||
if (selectedImage) {
|
||||
if (this.selectedImage) {
|
||||
event.preventDefault()
|
||||
this.selectedImage = null
|
||||
return this.deleteImage(selectedImage)
|
||||
return this.deleteImage(this.selectedImage)
|
||||
}
|
||||
|
||||
// Handle select all content.
|
||||
|
Loading…
Reference in New Issue
Block a user