-
Notifications
You must be signed in to change notification settings - Fork 236
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
Mask size incorrect when target element has a different box-sizing #1273
Comments
Thanks. I'd say option two would be the best. |
Ok, I'm going to send a pull request asap. |
I had to rewrite quite the whole method (see attached PR), because using I noticed The method looks also simpler to me now, and I'm not aware of any side-effect. |
@lorenzos could you make a fiddle showing the problem? I would be happy to help with the spec for this. |
@SergioCrisostomo Here you are: http://jsfiddle.net/6ncT3/ To be honest I expected different results in IE9-, instead looks like the behaviour is different in all IEs. Look at comments in the JS code. I admit I'm more confused than before... |
I suppose this is related to IE's box-model-bug. A broken IE spec for our getComputedStyle based on @lorenzos nice fiddle: http://jsfiddle.net/c2Xcd/ And a possible spec for the Spinner positioning (broken cross-browser): http://jsfiddle.net/57m3d/1/ |
I'm using Mask (Spinner, really) on an Element that has
box-sizing: border-box
. In this case the line Mask.js:119 obviously returns an incorrect target element size because padding and border are considered when they should not. So, the mask results bigger than it should.The issue for me is not that the default behaviour resizes the mask incorrectly, but it's the fact this behaviour cannot be changed. So, for me, the solution can be one of the following:
['padding', 'border']
array defined in Mask.js:115 and then used ingetComputedSize()
can be a class option instead of hardcoded there. That way also themaskMargins
option can be included in this new option, but I guess is better to leave also as it is for retro-compatibility.['padding', 'border']
can be built depending on the value ofthis.target.getStyle('box-sizing')
instead of hardcoded, but I'm not sure if this works on all browsers:box-sizing
is still somewhere not supported, partially supported or need prefixes (source).The text was updated successfully, but these errors were encountered: