leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

空文本情况设置selectAll,双击进入编辑报错

Open johnnhan opened this issue 1 month ago • 2 comments

// #图形编辑器 [打开内部编辑器]
import { App, Text } from 'leafer-ui'
import { InnerEditorEvent } from '@leafer-in/editor' // 导入图形编辑器插件  
import '@leafer-in/viewport' // 导入视口插件(可选)
import '@leafer-in/text-editor' // 导入文本编辑插件

const app = new App({
    view: window,
    editor: {}
})

app.tree.add(Text.one({
    width: 200,
    height: 20,
    placeholder: '请输入文本',
    text: '',
    editable: true, fill: '#FFE04B', fontSize: 16,
}, 100, 100, 100))

app.editor.on(InnerEditorEvent.BEFORE_OPEN, () => {
    app.editor.getInnerEditor('TextEditor').config.selectAll = false
})

johnnhan avatar Nov 20 '25 02:11 johnnhan

收到,谢谢反馈~

leaferjs avatar Nov 20 '25 10:11 leaferjs

已修复,等待新版本发布~

leaferjs avatar Nov 25 '25 09:11 leaferjs