Skip to content

Commit 86ce62a

Browse files
authored
Allow percentage as a valid unit for height
1 parent fa4f2d0 commit 86ce62a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/gridstack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
var height = val;
9999
var heightUnit = 'px';
100100
if (height && _.isString(height)) {
101-
var match = height.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);
101+
var match = height.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%)?$/);
102102
if (!match) {
103103
throw new Error('Invalid height');
104104
}

0 commit comments

Comments
 (0)