• Resolved mpotter21

    (@mpotter21)


    Hi there – I’m having a small issue on Chrome/Safari desktop where the screen jumps every time a user closes out of any modal window. An example can be seen with the headshot photos on the URL provided. Any idea why that might be happening?

    thanks!

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author merbmerb

    (@merbmerb)

    OK I took a quick look so I am not 100%. After the modal is closed focus is returned to the element on the screen that was active when the modal is opened. In this case its,

    div#ub-tabbed-content-62a42833-c8be-44a6-95d5-0ca797be9e96-panel-4.wp-block-ub-tabbed-content-tab-content-wrap.active

    When the focus is set/returned then the browser will scroll to that element which is why you see the jump.

    Taking a closer look at the headshot images they do not appear to receive focus, i.e. when I tab through the screen it sets focus on the container element for the headshots but the actual headshots never receive focus, (you cannot tab to them). Ideally, they should be able to receive focus and then when the modal closes the focus would return to the actual headshot rather than the container.

    Plugin Author merbmerb

    (@merbmerb)

    Looking a bit more images do not receive focus by default, I would need to wrap it in a tag when it’s created. Will consider for a future release.

    Plugin Author merbmerb

    (@merbmerb)

    Ah, so you are not using trigger by image. In which case what I can put in a future release is to set the focus back to the main page on modal close but not scroll to the focus field.

    Thread Starter mpotter21

    (@mpotter21)

    Ah that makes sense, thanks for getting back! Not sure why I didn’t think to just use the image as a trigger for these.

    Any idea when you’ll be able to add that in?

    thanks again for the help

    Plugin Author merbmerb

    (@merbmerb)

    I will try and get something out next week

    Plugin Author merbmerb

    (@merbmerb)

    Actually, if you want to make a quick edit to modal.js you can test it out for me:
    Change this line:

    
    // return focus to element that was active before modal called
    if (this.triggerElement) this.triggerElement.focus();
    

    to

    
    // return focus to element that was active before modal called
    if (this.triggerElement) this.triggerElement.focus({
    	preventScroll: true
    });
    
    Thread Starter mpotter21

    (@mpotter21)

    Yep that did it! This will get me by until the next update. Just let me know if you need me to test anything else.

    thanks again

    Plugin Author merbmerb

    (@merbmerb)

    NP glad it was an easy fix

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Screen jump on close’ is closed to new replies.