Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mmcossu opened this issue Mar 27, 2024 · 0 comments
Open

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

mmcossu opened this issue Mar 27, 2024 · 0 comments

Comments

@mmcossu
Copy link

mmcossu commented Mar 27, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant