Skip to content
Snippets Groups Projects
Commit 77f49f8c authored by Eryk Mika's avatar Eryk Mika
Browse files

fix: NumberWithUnit error handling

parent 7b845178
No related branches found
No related tags found
1 merge request!1Main
Pipeline #481889 failed with stages
in 4 seconds
......@@ -4,7 +4,13 @@ import {useState} from "react";
export default function NumberWithUnit({label, onChange, value, className}) {
const splitValues = function (fontSize) {
if( !fontSize ) {
return {size: "0", unit: "px"};
}
const match = fontSize.match(/^(\d+)([a-z%]+)$/i);
if (!match) {
return {size: "16", unit: "px"};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment