WordPress.org

Make WordPress Core

Changeset 46700


Ignore:
Timestamp:
11/11/2019 11:49:29 AM (9 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/comment-reply.js

    r45792 r46700  
    107107        };
    108108
    109         commentFormElement.addEventListener( 'keydown', submitFormHandler );
     109        if ( commentFormElement ) {
     110            commentFormElement.addEventListener( 'keydown', submitFormHandler );
     111        }
    110112
    111113        var links = replyLinks( context );
Note: See TracChangeset for help on using the changeset viewer.