fix(grid-layout): value parser will now accept strings or numbers (#8042)

This commit is contained in:
Nathan Walker
2019-11-29 07:40:24 -08:00
committed by Alexander Vakrilov
parent 2aa6e9bf92
commit 3199a392b4

View File

@@ -58,7 +58,8 @@ function convertGridLength(value: string): ItemSpec {
}
function parseAndAddItemSpecs(value: string, func: (itemSpec: ItemSpec) => void): void {
const arr = value.split(/[\s,]+/);
// ensure value is a string since view bindings could be parsed as number/int's here
const arr = `${value}`.split(/[\s,]+/);
for (let i = 0, length = arr.length; i < length; i++) {
const str = arr[i].trim();
if (str.length > 0) {