Comments: Check if comment form element exists before adding a key handler to detect the cmd/ctrl-enter key press.
Follow-up to [45790]. Props raamdev. Fixes #48543. See #41545. git-svn-id: https://develop.svn.wordpress.org/trunk@46700 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
1ee0c8e54f
commit
ae487b5f67
@ -106,7 +106,9 @@ window.addComment = ( function( window ) {
|
||||
}
|
||||
};
|
||||
|
||||
commentFormElement.addEventListener( 'keydown', submitFormHandler );
|
||||
if ( commentFormElement ) {
|
||||
commentFormElement.addEventListener( 'keydown', submitFormHandler );
|
||||
}
|
||||
|
||||
var links = replyLinks( context );
|
||||
var element;
|
||||
|
Loading…
Reference in New Issue
Block a user