mirror of
https://github.com/marktext/marktext.git
synced 2025-05-20 19:00:27 +08:00
bugfix: 1. auto focus when add table. 2. arrow left and up is unavailable when cursor in first cell in table
This commit is contained in:
parent
2870be80af
commit
56d3d9287b
@ -1,3 +1,5 @@
|
||||
<p align="center"><img src="https://github.com/marktext/marktext/blob/master/static/logo-small.png" alt="mark text"></p>
|
||||
|
||||
# MarkText
|
||||
|
||||
**MarkText** is an **open source** Markdown editor for OS X, released under the **MIT license**. It is inspired by outstanding markdown editor **Typora**.
|
||||
|
@ -36,7 +36,7 @@ const arrowCtrl = ContentState => {
|
||||
ContentState.prototype.findPreBlockInLocation = function (block) {
|
||||
const parent = this.getParent(block)
|
||||
const preBlock = this.getPreSibling(block)
|
||||
if (block.preSibling && preBlock.type !== 'input') { // handle task item
|
||||
if (block.preSibling && preBlock.type !== 'input' && preBlock.type !== 'div') { // handle task item and table
|
||||
return this.lastInDescendant(preBlock)
|
||||
} else if (parent) {
|
||||
return this.findPreBlockInLocation(parent)
|
||||
|
@ -17,7 +17,7 @@ let viewMenu = {
|
||||
}]
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development') {
|
||||
if (process.env.NODE_ENV !== 'production' || process.env.NODE_ENV === 'development') {
|
||||
// add devtool when development
|
||||
viewMenu.submenu.push({
|
||||
label: 'Toggle Developer Tools',
|
||||
|
@ -12,6 +12,7 @@
|
||||
<el-form :model="tableChecker" :inline="true">
|
||||
<el-form-item label="Rows">
|
||||
<el-input-number
|
||||
ref="rowInput"
|
||||
size="mini" v-model="tableChecker.rows"
|
||||
controls-position="right"
|
||||
:min="2"
|
||||
@ -101,6 +102,9 @@
|
||||
case 'table':
|
||||
this.tableChecker = { rows: 2, columns: 2 }
|
||||
this.dialogTableVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.rowInput.focus()
|
||||
})
|
||||
break
|
||||
case 'ul-bullet':
|
||||
case 'ul-task':
|
||||
|
BIN
static/logo-small.png
Normal file
BIN
static/logo-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
BIN
static/logo.png
Normal file
BIN
static/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 36 KiB |
Loading…
Reference in New Issue
Block a user