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
Closed

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

AlexEdgcomb opened this issue Feb 6, 2018 · 5 comments

Comments

@AlexEdgcomb
Copy link

@AlexEdgcomb AlexEdgcomb 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
Copy link
Member

@gibson042 gibson042 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?

@AlexEdgcomb
Copy link
Author

@AlexEdgcomb AlexEdgcomb 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
@averagehuman0G
Copy link

@averagehuman0G averagehuman0G commented Feb 27, 2018

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

@mgol
Copy link
Member

@mgol mgol 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
Copy link

@kktam kktam 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 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
Fixes gh-3964
Closes gh-4096
@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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants