Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes jQuery migrate error when getting offset when dropdownParent not in document #5644

Merged
merged 2 commits into from Sep 19, 2019

Commits on Sep 19, 2019

  1. Fixes error when getting offset of element not in document

    This fixes an error which is called out in jQuery Migrate but
    probably never happens in real life. This is because we call
    `jQuery.fn.offset` without checking if the element is in the
    document. Based on testing done here and within the MediaWiki
    team, I'm pretty sure jQuery never actually implemented explicit
    checks and this jQuery Migrate warning is just to cover the case
    where a browser might start returning inconsistnet results. And
    we could at least reproduce the inconsistency, so that's something.
    
    We now default the offset to 0/0 if the parent element happens to
    not be in the document. This appears to be what jQuery used to do
    in the past, and generally appears to be what people expect in
    these cases.
    
    This fixes #5584.
    kevin-brown committed Sep 19, 2019
    Configuration menu
    Copy the full SHA
    2c5467b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    31931a4 View commit details
    Browse the repository at this point in the history