styled raw input: make name property optional

This commit is contained in:
Elijah Duffy
2025-07-03 11:16:30 -07:00
parent 7a7fade491
commit ff9af6dd0a

View File

@@ -5,9 +5,10 @@
type InputValidatorEvent,
type ValidatorOptions
} from '@svelte-toolkit/validate';
import { generateIdentifier } from './util.js';
type $Props = Omit<HTMLInputAttributes, 'name' | 'value'> & {
name: string;
name?: string;
value?: string;
validate?: ValidatorOptions;
ref?: HTMLInputElement | null;
@@ -15,6 +16,7 @@
};
let {
id = generateIdentifier('styled-raw-input'),
name,
value = $bindable(''),
placeholder,
@@ -35,7 +37,7 @@
</script>
<input
id={name}
{id}
{name}
{placeholder}
aria-label={placeholder}