Bug Tracker

Ticket #9300 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

outerWidth(true) issue

Reported by: jon301@… Owned by: timmywil
Priority: high Milestone: 1.6.2
Component: dimensions Version: 1.6.1
Keywords: Cc:
Blocking: #9417 Blocked by:

Description

Hello,

outerWidth(true) on a hidden element seems to return the margin of the element (without its width)

For example, if my element is 100px width and has a 10px margin-left, outerWidth(true) will return 10. outerWidth() returns 100.

Look at this test case :  http://jsfiddle.net/CSwNr/

Change History

comment:1 Changed 4 years ago by timmywil

  • Priority changed from undecided to blocker
  • Status changed from new to open
  • Component changed from unfiled to dimensions
  • Milestone changed from 1.next to 1.6.2

Well that's not good.

comment:2 Changed 4 years ago by timmywil

The confusing part for me is how outerWidth() returns 100 the first time. That shouldn't work either.

comment:3 Changed 4 years ago by timmywil

  • Owner set to timmywil
  • Status changed from open to assigned

Ok, this makes sense. The fallback is not getting applied because val is not 0 after the getWH call due to the margin addition. Will do a fix.

comment:4 Changed 4 years ago by mikesherov

Last edited 4 years ago by mikesherov (previous) (diff)

comment:5 Changed 4 years ago by timmywil

  • Blocking 9417 added

(In #9417)  http://jsfiddle.net/timmywil/S8H2w/1/

It would be great if we could get this working, but it's not easy.

Related to #9300. This is different in that this element does not have a width set in its styles to retrieve as a fallback.

comment:6 Changed 4 years ago by timmywil

  • Priority changed from blocker to low

comment:7 Changed 4 years ago by timmywil

  • Priority changed from low to high

comment:8 Changed 4 years ago by mikesherov

comment:9 Changed 4 years ago by mikesherov

comment:10 Changed 4 years ago by Mike Sherov

  • Status changed from assigned to closed
  • Resolution set to fixed

Add margin after checking width. Add tests. Fixes #9441. Fixes #9300.

Changeset: 80ad14bd14467c547c2867f2677ca581aa29bf33

Note: See TracTickets for help on using tickets.