WordPress.org

Make WordPress Core

Ticket #48866: 48866.1.diff

File 48866.1.diff, 977 bytes (added by Hareesh Pillai, 6 months ago)

Updated patch

  • src/wp-content/themes/twentytwenty/assets/js/index.js

     
    341341                var anchorElements = document.querySelectorAll( 'a[href*="#"]' );
    342342                var anchorElementsList = Array.prototype.slice.call( anchorElements );
    343343                anchorElementsList.filter( function( element ) {
    344                         if ( element.href === '#' || element.href === '#0' || element.id === 'cancel-comment-reply-link' || element.classList.contains( 'do-not-scroll' ) || element.classList.contains( 'skip-link' ) ) {
     344                        if ( element.href === '#' || element.href === '#0' || element.id === 'cancel-comment-reply-link' || element.classList.contains( 'do-not-scroll' ) || element.classList.contains( 'skip-link' ) || -1 !== element.href.search( '#comments' ) ) {
    345345                                return false;
    346346                        }
    347347                        return true;