Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#10725 closed bug (fixed)

Draggable: Draggable elements receive an explicit height in Firefox only

Reported by: orfc Owned by: tj.vantoll
Priority: minor Milestone: 1.12.0
Component: ui.draggable Version: 1.11.2
Keywords: regression Cc:
Blocked by: Blocking:

Description

Firefox is v34.0.5

Made a draggable composed of two parts. Header (with the handle) and content. A button in the header should hide/show the content.

http://jsfiddle.net/cdv5bLLh/ jquery ui v.1.10.3, works ok in firefox,

http://jsfiddle.net/ck93q4of/53/ jquery ui v.1.11.2, works before dragging in firefox, but dragging then gives height css property a set value, so hiding/showing alters the display of the content but the containing box won't change in size (as the height property isn't auto anymore)

Looking through the new code it seems a call to normalizeRightBottom sets the height to a calculated value if the right and bottom position values aren't detected as "auto". Unfortunately firefox never returns values as "auto"

https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle#Notes

In Firefox, properties with the value auto return the used value, not the value auto

Change History (13)

comment:1 Changed 2 years ago by orfc

Whoops, make the version that works in firefox as http://jsfiddle.net/cdv5bLLh/2/

comment:2 Changed 2 years ago by tj.vantoll

Status: newopen
Summary: draggble error in firefox + jquery 1.11.2. NormalizeRightBottom call overrides height "auto" value.Draggable: Draggable elements receive an explicit height in Firefox only

I would agree that we shouldn't set height unless we need to. I verified that the this.helper.css( "bottom" ) call in _normalizeRightBottom() returns "auto" in Chrome but a pixel amount (e.g. "-142px") in Firefox.

This changed in 1.11.2 per this commit: https://github.com/jquery/jquery-ui/commit/8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5.

comment:3 Changed 2 years ago by Scott González

#10729 is a duplicate of this ticket.

comment:4 Changed 2 years ago by mikesherov

Firefox is following the spec here in that it uses the "resolved value" which for trbl is always a pixel value. There is currently no way in the CSSOM to know simultaneously whether an element has auto applied or not. We need to accept one of two answers: 1. Auto height is broken. or 2. Right/bottom is broken.

I'll go to the CSS working group with this in the new year, but don't expect any miracles ;)

Scott, what do you want to do here?

comment:5 Changed 2 years ago by Scott González

I'd say we revert 8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5, close #7772 as a duplicate of #3011, and continue to leave #3011 open for the possibility of eventually adding an option to make this work.

comment:6 in reply to:  5 Changed 2 years ago by tj.vantoll

Replying to scott.gonzalez:

I'd say we revert 8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5, close #7772 as a duplicate of #3011, and continue to leave #3011 open for the possibility of eventually adding an option to make this work.

+1

comment:7 Changed 2 years ago by mikesherov

Owner: set to mikesherov
Status: openassigned

Ok. I'll do that then.

comment:8 Changed 2 years ago by tj.vantoll

#11776 is a duplicate of this ticket.

comment:9 Changed 2 years ago by tj.vantoll

comment:10 Changed 2 years ago by tj.vantoll

Keywords: regression added
Owner: changed from mikesherov to tj.vantoll

comment:11 Changed 2 years ago by TJ VanToll

Resolution: fixed
Status: assignedclosed

Revert "Draggable: Set explicit width/height instead of right/bottom"

This reverts commit 8eca7b8f45885d20c13f1bf64cad8bee5fc1d5c5.

Fixes #10725

Changeset: d0ea32e3ad613eaaa523d0c88c776dab2b26b25f

comment:12 Changed 2 years ago by tj.vantoll

Milestone: none1.12.0

comment:13 Changed 2 years ago by Scott González

#12232 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.