Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outerWidth of svg yields NaNpx. Previously yielded a number. #3964

Closed
AlexEdgcomb opened this Issue Feb 6, 2018 · 5 comments

Comments

Projects
None yet
6 participants
@AlexEdgcomb
Copy link

commented Feb 6, 2018

Description

On v3.3.1, outerWidth() of an svg yields NaNpx.

I expected a number. Prior versions (e.g., v3.2.1) yielded a number.

Issue reproduces on each OS/browser combo I tried: Mac/{Chrome, Firefox, Safari} and Windows/{Edge, Firefox, Chrome}.

Link to test case

v3.3.1: https://jsfiddle.net/u9pk0gdq/1/ (yields NaNpx)

v3.2.1: https://jsfiddle.net/378suvLg/ (yields a number)

@gibson042

This comment has been minimized.

Copy link
Member

commented Feb 6, 2018

Hmm, interesting. SVG elements don't have offsetWidth or offsetHeight, so boxModelAdjustment gets NaN when trying to calculate their scroll gutters. This can be fixed by adding an || 0 in the final delta adjustment and covering SVG dimension getters with unit tests. Would you like to contribute a PR, @AlexEdgcomb?

@gibson042 gibson042 added the Dimensions label Feb 6, 2018

@AlexEdgcomb

This comment has been minimized.

Copy link
Author

commented Feb 6, 2018

@gibson042 , I appreciate the offer, but I'll pass this round. Thanks!

@gibson042 gibson042 added this to the 3.4.0 milestone Feb 12, 2018

@jonathanv3232

This comment has been minimized.

Copy link

commented Feb 27, 2018

@gibson042 I'd like to give this a shot, could it be assigned to me?

@mgol

This comment has been minimized.

Copy link
Member

commented Feb 27, 2018

@jonathanv3232 GitHub doesn't allow to assign issues to people without commit access to the repo so we can't set you but feel free to take a shot at a PR!

@kktam

This comment has been minimized.

Copy link

commented Mar 27, 2018

Submitted PR for the fix.

jbedard added a commit to jbedard/jquery that referenced this issue Jun 4, 2018

jbedard added a commit to jbedard/jquery that referenced this issue Jun 11, 2018

jbedard added a commit to jbedard/jquery that referenced this issue Jun 11, 2018

@jbedard jbedard referenced this issue Jun 11, 2018

Merged

Dimensions: fix computing outerWidth on SVGs #4096

0 of 4 tasks complete

@jbedard jbedard self-assigned this Jun 11, 2018

jbedard added a commit to jbedard/jquery that referenced this issue Jun 12, 2018

jbedard added a commit that referenced this issue Jun 21, 2018

@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.