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

[@mantine/dates] DateInput: clear input value on clearButton click #4486

Merged
merged 1 commit into from Jul 4, 2023

Conversation

mrbnclt
Copy link
Contributor

@mrbnclt mrbnclt commented Jun 29, 2023

This fixes #4481.

When Calendar Dropdown is open then the user clicks on the clear button, the following code won't run causing the input value to not be cleared.

useDidUpdate(() => {
    value !== undefined && !dropdownOpened && setInputValue(formatValue(value));
  }, [value]);

So when user clicks on the clear button we also closes the Calendar Dropdown which fixes the issue.

As other Date components, clicking the clear button closes the Calendar Dropdown, this should also make the behavior consistent across components.

@rtivital rtivital merged commit 6affc45 into mantinedev:master Jul 4, 2023
1 check passed
@rtivital
Copy link
Member

rtivital commented Jul 4, 2023

Thanks!

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