File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -71,12 +71,14 @@ var codeInput = {
7171 // Prevent this from running multiple times on the same input when "value" attribute is changed,
7272 // by not running when value is already equal to the input of this (implying update has already
7373 // been run). Thank you to peterprvy for this.
74- if ( this . value == text ) return ;
74+ if ( this . ignoreValueUpdate ) return ;
7575
7676 console . log ( "Update" , text ) ;
77-
77+ this . ignoreValueUpdate = true ;
7878 this . value = text ; // Change value attribute if necessary.
79- if ( this . querySelector ( "textarea" ) . value != text ) this . querySelector ( "textarea" ) . value = text ;
79+ this . ignoreValueUpdate = false ;
80+ if ( this . querySelector ( "textarea" ) . value != text ) this . queryS
81+ this . querySelector ( "textarea" ) . value = text ;
8082
8183
8284 let result_element = this . querySelector ( "pre code" ) ;
@@ -217,7 +219,7 @@ var codeInput = {
217219 if ( this . template . preElementStyled ) this . classList . add ( "code-input_pre-element-styled" ) ;
218220 else this . classList . remove ( "code-input_pre-element-styled" ) ;
219221 // Syntax Highlight
220- this . update ( this . value ) ;
222+ this . update ( this . value , true ) ;
221223
222224 break ;
223225
You can’t perform that action at this time.
0 commit comments