Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter bdcstr

    (@bdcstr)

    Duh !!

    It was not obvious to be honest. Moreover, I’m not sure why the URL would differ from one language to another when related to social links. Maybe a restriction from Polylang?

    Anyway, thank you 🙂

    Noticed the same issue. This is my temporary-and-not-perfect solution (so don’t judge me!) while waiting for the official patch.

    1. Go to themes/twentytwenty/assets/js/index.js
    2. Look for the outsideUntoggle: function () { (at line 135 for me)
    3. Change with the following code:

        outsideUntoggle: function () {
            document.addEventListener('click', function (event) {
                var target = event.target;
                var modal = document.querySelector('.cover-modal.active');
    
                // if target on click is <a> with # within the href attribute
                if (event.target.tagName.toLowerCase() === 'a' && event.target.hash.includes('#')) {
                    // untoggle the modal
                    this.untoggleModal(modal);
                    // wait 550 and scroll to the anchor
                    setTimeout(function () {
                        var anchor = document.getElementById(event.target.hash.slice(1)); // 
                        anchor.scrollIntoView();
                    }, 550);
                }
    
                if (target === modal) {
                    this.untoggleModal(target);
                }
            }.bind(this));
        },

    4. Hope it helps 😉

    Cheers!

    • This reply was modified 6 years, 3 months ago by bdcstr.
    • This reply was modified 6 years, 3 months ago by bdcstr.

    Works like a charm, thank you.

    Please include in next update!

Viewing 3 replies - 1 through 3 (of 3 total)