question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@mantine/dates] TimeInput: not possible to set empty value

See original GitHub issue

What package has an issue

@mantine/dates

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:closed
  • Created 2 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
rtivitalcommented, Dec 29, 2021

Alright, so what we can do about it:

  • Allow input to be empty initially
  • Add clearableprop, that will show clear button
  • When value is filled, it can be cleared only with clear button

@jerebtw you can work on it, you can do it in the same PR as your format on time input to avoid conflicts

0reactions
rtivitalcommented, Jan 13, 2022

Added in 3.6.0

Read more comments on GitHub >

github_iconTop 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 >
TimeInput
Capture time or time range from user.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found