File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -865,7 +865,13 @@ var codeInput = {
865865 addEventListener ( type , listener , options = undefined ) {
866866 // Save a copy of the callback where `this` refers to the code-input element.
867867 // This callback is modified to only run when the handleEventsFromTextarea is set.
868- let boundCallback = function ( evt ) { listener ( evt ) ; } . bind ( this ) ;
868+ let boundCallback = function ( evt ) {
869+ if ( typeof listener === 'function' ) {
870+ listener ( evt ) ;
871+ } else if ( listener && listener . handleEvent ) {
872+ listener . handleEvent ( evt ) ;
873+ }
874+ } . bind ( this ) ;
869875 this . boundEventCallbacks [ listener ] = boundCallback ;
870876
871877 if ( codeInput . textareaSyncEvents . includes ( type ) ) {
@@ -1041,4 +1047,4 @@ var codeInput = {
10411047 }
10421048}
10431049
1044- customElements . define ( "code-input" , codeInput . CodeInput ) ;
1050+ customElements . define ( "code-input" , codeInput . CodeInput ) ;
You can’t perform that action at this time.
0 commit comments