This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 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 {
352352 * @param {Object } pos
353353 * @param {string } str
354354 * @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.
357355 * @return {Number } how far from position (in characters) the insertion ended.
358356 * This can be more than the length of `str` when crossing non-editable parts, which are skipped.
359357 */
@@ -384,7 +382,13 @@ export default class EditorModel {
384382 }
385383 while ( str ) {
386384 const newPart = this . _partCreator . createPartForInput ( str , index , inputType ) ;
385+ const oldStr = str ;
387386 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+ }
388392 this . insertPart ( index , newPart ) ;
389393 index += 1 ;
390394 }
You can’t perform that action at this time.
0 commit comments