semantic-ui-calendar-react icon indicating copy to clipboard operation
semantic-ui-calendar-react copied to clipboard

TimeInput issue with clearable

Open happyduong opened this issue 5 years ago • 2 comments

Describe the bug The time list can't be returned to its original list when clicked clear X button.

To Reproduce Steps to reproduce the behavior:

  1. Click on TimeInput then choose a time. ex: 04:00
  2. Then click on clear X button
  3. Click on TimeInput, then you can see the list time of 04:00 , 04:05, 04:10, ... => It's wrong!

So when click clear X button, the time list need to be original list.

happyduong avatar Jan 06 '20 14:01 happyduong

If you're setting the value of the calendar, you'll need to set the value back to the original time that you want.

You can also use the onClear prop to trigger a function when the clear function is clicked:

<DateInput
  value={this.state.dateValue}
  clearable
  onClear={() => this.setState({ dateValue: '01-01-2020' })}
/>

^ Something like that should answer your question. @ocvninfo - Does that help?

DovahBrownies avatar Jan 23 '20 09:01 DovahBrownies

I have the same issue and this is not as simple as you think it is @DovahBrownies. I for the life of me cannot get it to reset correctly in the time input.

https://github.com/arfedulov/semantic-ui-calendar-react/issues/221

https://www.loom.com/share/2592e58efab54c9fb00f848b6afdcb8b

mpaccione avatar Jun 03 '21 02:06 mpaccione