When google translator is place in the footer of a website, all pages (with the footer) automatically scrolls to the bottom upon page load or refresh.
It may have something to do with tab-indexing of the form elements, or some other attribute?
Issue fork google_translator-3496864
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
ethantI think this is related / the same as the bug I am seeing where a page bounces to the top when the widget is in the header of the site after visiting a page anchor. Adding a patch.
Comment #7
gauravjeet commentedThis MR by ethant seems to fix the scrolling issue - https://git.drupalcode.org/project/google_translator/-/merge_requests/9
Comment #8
jenna.tollerson1. I don't understand why all the javascript needs to be rewritten to fix this bug. If the javascript needs to be modernized, that seems like a separate issue. If there's something rewriting the entire file fixes that I can't see, please explain.
2. Removing
window.setTimeout(() => gadget.focus(), 500);may fix this bug, but it's a step backwards for accessibility. That line is there to to fix an issue with accessibility for users that navigate the site via keyboard. We must give the focus to the loaded widget so they don't lose their place in the page. Otherwise they have to tab back to it.Comment #10
jenna.tollersonI would appreciate feedback on whether the newest commit fixes this issue for folks.
Comment #11
amitsharma27sept commentedLooks ok to me and working
Comment #12
amitsharma27sept commentedBy when this can be released? It is creating accessibility issue for us.
Comment #13
jenna.tollersonAre we calling this RTBC? It's been pretty quiet.
Comment #14
amitsharma27sept commentedI tested and confirm that change resolves the issue of moving to top on page load.
This also resolves the page scrolling to top if page is not scrolling to ids on the page if loaded with # links.
Thak you for your work on this.
Comment #15
jenna.tollersonThank you for testing. :)
Fixed in 2.3.1
Comment #17
amitsharma27sept commentedHi,
I checked this again after update, it looks like this does not fix for users who are vising the page first time with # in url. If they use any element with in page id with #, and coming on website first time (i.e. googtrans cookie is not set), it force focus on translator dropdown and hence loosing the context of accessing url with '#'.
Can we also put some check to not force focus on translator dropdown by checking "location.hash" ?