date-picker-svelte
date-picker-svelte copied to clipboard
Feature Request: DateInput: ability to disable or make it view only
Currently I have a custom wrapper component for input
, like so:
<LabelInput
label="Date"
id="date"
name="date"
required
{disabled}
>
<span slot="dateInput">
<DateInput
bind:value={date}
format="MM/dd/yyyy"
{min}
{max}
placeholder={min.toLocaleDateString(undefined, {
year: "numeric",
month: "numeric",
day: "numeric",
})}
/>
</span>
</LabelInput>
adding a disable
prop to the DateInput
would be a nice QoL feature when the component is meant only for displaying dates
Agreed, that would be a nice addition. I'm imagining it just adding the disabled
attribute to the <input>
element, and making everything a bit transparent to indicate it's disabled
Added in v2.2.0 by @ChromuSx