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 <samuel.r.attard@gmail.com>

Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
Abhishek Shingane 2020-11-02 15:25:59 +05:30 committed by GitHub
parent f61dedb7e5
commit d16e61dc85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {