WordPress.org

Make WordPress Core

Ticket #47510: 47510.diff

File 47510.diff, 925 bytes (added by eherman24, 2 years ago)

Set event listeners to passive

  • src/js/_enqueues/lib/comment-reply.js

    diff --git a/src/js/_enqueues/lib/comment-reply.js b/src/js/_enqueues/lib/comment-reply.js
    index 723b532073..af7f85893c 100644
    a b window.addComment = ( function( window ) { 
    9292                        return;
    9393                }
    9494
    95                 cancelElement.addEventListener( 'touchstart', cancelEvent );
     95                cancelElement.addEventListener( 'touchstart', cancelEvent, { passive: true } );
    9696                cancelElement.addEventListener( 'click',      cancelEvent );
    9797
    9898                // Submit the comment form when the user types CTRL or CMD + 'Enter'.
    window.addComment = ( function( window ) { 
    114114                for ( var i = 0, l = links.length; i < l; i++ ) {
    115115                        element = links[i];
    116116
    117                         element.addEventListener( 'touchstart', clickEvent );
     117                        element.addEventListener( 'touchstart', clickEvent, { passive: true } );
    118118                        element.addEventListener( 'click',      clickEvent );
    119119                }
    120120        }