date-picker-svelte icon indicating copy to clipboard operation
date-picker-svelte copied to clipboard

Feature Request: DateInput: ability to disable or make it view only

Open Gildedter opened this issue 2 years ago • 1 comments

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

Gildedter avatar Jun 09 '22 03:06 Gildedter

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

probablykasper avatar Jun 09 '22 17:06 probablykasper

Added in v2.2.0 by @ChromuSx

probablykasper avatar Sep 06 '22 17:09 probablykasper