Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14848 closed bug (fixed)

on at least some form elements .hide(0) acts as a toggle instead of simply hiding

Reported by: [email protected] Owned by: gibson042
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:


If .hide() is applied with duration 0 (I haven't actually tried other values yet), either as a single argument or an object {duration: 0}, to some elements within a form (at least the label & radio buttons will work this way), it acts as a toggle instead of just hiding the element regardless of its former state.

Without arguments, it behaves correctly.

If you switch to jQuery-1.10.2, it behaves as expected.

It seems to (mis)behave the same in Firefox & Chrome. I don't know about IE yet.


Click the "hide it" button repeatedly. The <p> element disappears, and stays hidden; the label & associated input toggle between hidden & shown.

Change History (5)

comment:1 Changed 9 years ago by [email protected]

Also, for a slightly more reduced case, it works similarly if you remove the label element but leave the input, and update the JS .hide() line appropriately, except that then it's only the button itself that toggles, of course, and the text remains shown throughout.


comment:2 Changed 9 years ago by KarMannJRO

Biggest, less reduced case shows that it affects all type of input elements (except hidden, I suppose) and textareas & labels alike.


comment:3 Changed 9 years ago by gibson042

Owner: set to gibson042
Status: newassigned

comment:4 Changed 9 years ago by KarMannJRO

Also, I've tried it with other values for duration, and it looks like it doesn't matter what the value is, just that it's specified. Also, the showing is always instant regardless of duration value. Handy test cases here: http://jsfiddle.net/KarMannJRO/YTGvH/6/

Last edited 9 years ago by KarMannJRO (previous) (diff)

comment:5 Changed 9 years ago by Richard Gibson

Resolution: fixed
Status: assignedclosed

Effects: Don't overwrite display:none when .hide()ing hidden elements

Fixes #14848 Closes gh-1548

Changeset: 890d441aa5d319e49951ba6f0ec719cd4cb96759

Note: See TracTickets for help on using tickets.