@@ -166,7 +166,7 @@ export const editable = <T>(
166
166
const document = getCurrentDocument ( element ) ;
167
167
168
168
const history = createHistory <
169
- readonly [ value : DocFragment , selection : SelectionSnapshot ]
169
+ readonly [ doc : DocFragment , selection : SelectionSnapshot ]
170
170
> ( [
171
171
takeDomSnapshot ( document , element , parserConfig , serializeVoid ) ,
172
172
currentSelection ,
@@ -204,7 +204,7 @@ export const editable = <T>(
204
204
205
205
const restoreSelectionOnTimeout = ( ) => {
206
206
// We set updated selection after the next rerender, because it will modify DOM and selection again.
207
- // However frameworks may not rerender for optimization in some case, for example if selection is updated but value is the same.
207
+ // However frameworks may not rerender for optimization in some case, for example if selection is updated but document is the same.
208
208
// So we also schedule restoring on timeout for safe.
209
209
const nextSelection = currentSelection ;
210
210
restoreSelectionQueue = setTimeout ( ( ) => {
@@ -259,14 +259,14 @@ export const editable = <T>(
259
259
260
260
observer . _accept ( false ) ;
261
261
if ( queue . length ) {
262
- // Get current value and selection from DOM
262
+ // Get current document and selection from DOM
263
263
const selection = takeSelectionSnapshot (
264
264
document ,
265
265
element ,
266
266
isSingleline ,
267
267
parserConfig
268
268
) ;
269
- const value = takeDomSnapshot (
269
+ const doc = takeDomSnapshot (
270
270
document ,
271
271
element ,
272
272
parserConfig ,
@@ -301,7 +301,7 @@ export const editable = <T>(
301
301
parserConfig
302
302
) ;
303
303
304
- updateState ( value , selection , currentSelection ) ;
304
+ updateState ( doc , selection , currentSelection ) ;
305
305
}
306
306
} ;
307
307
0 commit comments