Feat:非富文本模式支持输入和渲染空行;Fix:修复非富文本模式下节点存在图标时,进入文本编辑时文本编辑框位置不正确的问题
This commit is contained in:
parent
7fd4c7504d
commit
24363d55a4
@ -270,8 +270,13 @@ function createTextNode(specifyText) {
|
|||||||
}
|
}
|
||||||
textArr[index] = lines.join('\n')
|
textArr[index] = lines.join('\n')
|
||||||
})
|
})
|
||||||
textArr = textArr.join('\n').split(/\n/gim)
|
textArr = textArr.join('\n').replace(/\n$/g, '').split(/\n/gim)
|
||||||
textArr.forEach((item, index) => {
|
textArr.forEach((item, index) => {
|
||||||
|
// 避免尾部的空行不占宽度
|
||||||
|
// 同时解决该问题:https://github.com/wanglin2/mind-map/issues/1037
|
||||||
|
if (item === '') {
|
||||||
|
item = ''
|
||||||
|
}
|
||||||
const node = new Text().text(item)
|
const node = new Text().text(item)
|
||||||
node.addClass('smm-text-node-wrap')
|
node.addClass('smm-text-node-wrap')
|
||||||
this.style.text(node)
|
this.style.text(node)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user