This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -352,8 +352,6 @@ export default class EditorModel {
352
352
* @param {Object } pos
353
353
* @param {string } str
354
354
* @param {string } inputType the source of the input, see html InputEvent.inputType
355
- * @param {bool } options.validate Whether characters will be validated by the part.
356
- * Validating allows the inserted text to be parsed according to the part rules.
357
355
* @return {Number } how far from position (in characters) the insertion ended.
358
356
* This can be more than the length of `str` when crossing non-editable parts, which are skipped.
359
357
*/
@@ -384,7 +382,13 @@ export default class EditorModel {
384
382
}
385
383
while ( str ) {
386
384
const newPart = this . _partCreator . createPartForInput ( str , index , inputType ) ;
385
+ const oldStr = str ;
387
386
str = newPart . appendUntilRejected ( str , inputType ) ;
387
+ if ( str === oldStr ) {
388
+ // nothing changed, break out of this infinite loop and log an error
389
+ console . error ( `Failed to update model for input (str ${ str } ) (type ${ inputType } )` ) ;
390
+ break ;
391
+ }
388
392
this . insertPart ( index , newPart ) ;
389
393
index += 1 ;
390
394
}
You can’t perform that action at this time.
0 commit comments