@@ -94,6 +94,9 @@ export class CellEditor extends ToolsView.ToolItem<
9494 }
9595 editor . innerText = text || ''
9696
97+ // clear display value when edit status because char ghosting.
98+ this . setCellText ( '' )
99+
97100 return this
98101 }
99102
@@ -102,15 +105,7 @@ export class CellEditor extends ToolsView.ToolItem<
102105 const cell = this . cell
103106 const value = this . editor . innerText . replace ( / \n $ / , '' ) || ''
104107 // set value
105- const setText = this . options . setText
106- if ( typeof setText === 'function' ) {
107- FunctionExt . call ( setText , this . cellView , {
108- cell : this . cell ,
109- value,
110- index : this . labelIndex ,
111- distance : this . distance ,
112- } )
113- }
108+ this . setCellText ( value )
114109 // remove tool
115110 cell . removeTool ( cell . isEdge ( ) ? 'edge-editor' : 'node-editor' )
116111 this . undelegateDocumentEvents ( )
@@ -141,6 +136,18 @@ export class CellEditor extends ToolsView.ToolItem<
141136 selection . addRange ( range )
142137 }
143138 }
139+
140+ setCellText ( value : string ) {
141+ const setText = this . options . setText
142+ if ( typeof setText === 'function' ) {
143+ FunctionExt . call ( setText , this . cellView , {
144+ cell : this . cell ,
145+ value,
146+ index : this . labelIndex ,
147+ distance : this . distance ,
148+ } )
149+ }
150+ }
144151}
145152
146153export namespace CellEditor {
0 commit comments