Skip to main content

Bug Tracker

Side navigation

#14848 closed bug (fixed)

Opened March 05, 2014 12:32AM UTC

Closed March 21, 2014 02:57AM UTC

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

Reported by: randy@e-junkie.com Owned by: gibson042
Priority: undecided Milestone: None
Component: unfiled Version: 1.11.0
Keywords: Cc:
Blocked by: Blocking:
Description

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.

http://jsfiddle.net/KarMannJRO/YTGvH/

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

Attachments (0)
Change History (5)

Changed March 05, 2014 11:25PM UTC by randy@e-junkie.com comment:1

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.

http://jsfiddle.net/KarMannJRO/YTGvH/3/

Changed March 06, 2014 12:15AM UTC by KarMannJRO comment:2

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

http://jsfiddle.net/KarMannJRO/YTGvH/4/

Changed March 10, 2014 04:39PM UTC by gibson042 comment:3

owner: → gibson042
status: newassigned

Changed March 10, 2014 07:00PM UTC by KarMannJRO comment:4

_comment0: 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. Handy test cases here: http://jsfiddle.net/KarMannJRO/YTGvH/6/1394486002610561

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/

Changed March 21, 2014 02:57AM UTC by Richard Gibson comment:5

resolution: → fixed
status: assignedclosed

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

Fixes #14848

Closes gh-1548

Changeset: 890d441aa5d319e49951ba6f0ec719cd4cb96759