Skip to content

Hidden checkbox input with position:absolute breaks Chrome #2304

Open
@marcnarc

Description

(Apologies that I don't have a convenient reproduction of this problem, I'm working with private code that I cannot share.)

The ui-helper-hidden-accessible class specifies position:absolute. When this applies to a checkbox <input>, Chrome suffers from what appears to be a long-standing side-effect, as described in this ancient StackOverflow question: If the checkbox is contained in a bunch of nested <div>s where one of the ancestors is vertically scrolled, when the checkbox is clicked the scrolled ancestor's top/y value is adjusted by the scrolled amount, causing the <div> to become clipped at the top. If there's enough scrolling, the <div> can disappear entirely.

This does not happen in Firefox.

To work around this, I set position:fixed explicitly on the checkbox <input>, overriding ui-helper-hidden-accessible's value.

I think jQueryUI should address this problem. I'm not sure if it's OK to change ui-helper-hidden-accessible's value for position, or if it should only be done for checkbox <input>s (or if there's a better way to deal with this).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions