[@mantine/dates] TimeInput: not possible to set empty value
See original GitHub issueWhat package has an issue
Describe the bug
When setting the value
prop of <TimeInput />
to undefined
(eg. <TimeInput value={undefined} />
, the time value is still displayed (it uses the current timestamp by default).
My use-case: I have <TimeInput />
as a form input. The default value is undefined
as I want the user to fill it in. However, the user always sees a timestamp so they don’t fill in the field assuming the current timestamp is being used. Under the hood however, the value is still undefined
.
In which browser did the problem occur
Chrome
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/competent-sammet-t6mje?file=/src/App.tsx
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
Yes
Possible fix
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Input DatePicker and TimeInput required prop not working
What package has an issue @mantine/dates Describe the bug Hi, this code not working as expected In form block it isn't catch empty...
Read more >How can I make a DateTimePicker display an empty string?
Just set the property as follows: When the user press "clear button" or "delete key" do dtpData.CustomFormat = " " 'An empty SPACE...
Read more >Solved: DatePicker empty value - Power Platform Community
Solved: Have been playing some more with the DatePicker in an EditForm, but can't seem to work out how to ensure a blank...
Read more >Set jqxdatetimeinput empty Value - Forums
Hi,. When i try to set empty value to datetimeinput. It throws error saying ” Unable to get property '_daysInMonth' of undefined or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Alright, so what we can do about it:
clearable
prop, that will show clear button@jerebtw you can work on it, you can do it in the same PR as your
format
on time input to avoid conflictsAdded in 3.6.0