Browse Source

fix: window.open not accepting size values with "px" at the end (#26104)

* fix: use parseInt to parse sizes

* fix: pass radix to parseInt

Co-authored-by: Samuel Attard <[email protected]>

Co-authored-by: Cheng Zhao <[email protected]>
Co-authored-by: Samuel Attard <[email protected]>
Abhishek Shingane 4 years ago
parent
commit
d16e61dc85
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/common/parse-features-string.ts

+ 1 - 1
lib/common/parse-features-string.ts

@@ -38,7 +38,7 @@ const keysOfTypeNumber = ['top', 'left', ...Object.keys(keysOfTypeNumberCompileT
 type CoercedValue = string | number | boolean;
 function coerce (key: string, value: string): CoercedValue {
   if (keysOfTypeNumber.includes(key)) {
-    return Number(value);
+    return parseInt(value, 10);
   }
 
   switch (value) {