mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-07 12:49:07 +02:00
When the container padding is an empty string, handle it as 0px (#7349)
This commit is contained in:
parent
a301ca148c
commit
ae99039e4d
@ -80,6 +80,12 @@ function getConstraintHeight(domNode) {
|
|||||||
function _calculatePadding(container, padding, parentDimension) {
|
function _calculatePadding(container, padding, parentDimension) {
|
||||||
padding = getStyle(container, padding);
|
padding = getStyle(container, padding);
|
||||||
|
|
||||||
|
// If the padding is not set at all and the node is not in the DOM, this can be an empty string
|
||||||
|
// In that case, we need to handle it as no padding
|
||||||
|
if (padding === '') {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10);
|
return padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user