-
Notifications
You must be signed in to change notification settings - Fork 235
Mask size incorrect when target element has a different box-sizing #1273
Copy link
Copy link
Open
Description
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:
- The
['padding', 'border']array defined in Mask.js:115 and then used ingetComputedSize()can be a class option instead of hardcoded there. That way also themaskMarginsoption can be included in this new option, but I guess is better to leave also as it is for retro-compatibility. - The same
['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-sizingis still somewhere not supported, partially supported or need prefixes (source).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels