Skip to content

DatePicker won't reset on reset button press within an html form  #246

@mmcossu

Description

@mmcossu

put the DatePicker in a form with a reset button and assign an inputName:

export function PickerExample() {
  return (
    <form>
      <DatePicker inputName={'_in'} value={null} onChange={_ => {}}/>
      <button type=reset">Reset</button>
    </form>
  )
}

Select a date, then press the reset button...
Normally a reset event should trigger a form elements collection to adopt the reset mechanism, by emptying themselves.
Although the DatePicker component includes a element, this won't be cleared.

It should either expose a .Reset() function to be invoked via the useRef() hook, or it should be fixed to use the form events as intended.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions