Ver código fonte

ref: change randomId lengths

Sv443 5 meses atrás
pai
commit
d55ead02c3
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      src/components/toggleInput.ts
  2. 1 1
      src/utils/dom.ts

+ 1 - 1
src/components/toggleInput.ts

@@ -17,7 +17,7 @@ export interface ToggleInputProps {
 export async function createToggleInput({
   onChange,
   initialValue = false,
-  id = randomId(8, 26),
+  id = randomId(6, 36),
   labelPos = "left",
 }: ToggleInputProps) {
   const wrapperEl = document.createElement("div");

+ 1 - 1
src/utils/dom.ts

@@ -171,7 +171,7 @@ export async function addStyle(css: string, ref?: string, transform: (css: strin
   if(!domLoaded)
     throw new Error("DOM has not finished loading yet");
   const elem = addGlobalStyle(await transform(css));
-  elem.id = `bytm-style-${ref ?? randomId(5, 36)}`;
+  elem.id = `bytm-style-${ref ?? randomId(6, 36)}`;
   return elem;
 }