styled raw input: make name property optional
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user