fix(auth): unify Desktop and Web SQLite DB path and fix browser autofill crash on Input/AuthGate
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { type InputHTMLAttributes } from "react";
|
||||
import { useId, type InputHTMLAttributes } from "react";
|
||||
|
||||
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
label?: string;
|
||||
@@ -7,7 +7,8 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
}
|
||||
|
||||
export function Input({ label, hint, error, id, className = "", ...rest }: InputProps) {
|
||||
const inputId = id ?? `input-${Math.random().toString(36).slice(2, 8)}`;
|
||||
const reactId = useId();
|
||||
const inputId = id ?? `input-${reactId}`;
|
||||
return (
|
||||
<div className="ps-field">
|
||||
{label && <label htmlFor={inputId} className="ps-field-label">{label}</label>}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type SelectHTMLAttributes } from "react";
|
||||
import { useId, type SelectHTMLAttributes } from "react";
|
||||
|
||||
export interface SelectOption {
|
||||
value: string;
|
||||
@@ -11,7 +11,8 @@ export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
||||
}
|
||||
|
||||
export function Select({ label, options, id, className = "", ...rest }: SelectProps) {
|
||||
const selectId = id ?? `select-${Math.random().toString(36).slice(2, 8)}`;
|
||||
const reactId = useId();
|
||||
const selectId = id ?? `select-${reactId}`;
|
||||
return (
|
||||
<div className="ps-field">
|
||||
{label && <label htmlFor={selectId} className="ps-field-label">{label}</label>}
|
||||
|
||||
Reference in New Issue
Block a user