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

Validation display at keydown but give feedback at blur #1325

Closed
tgaeta opened this issue Sep 23, 2019 · 2 comments
Closed

Validation display at keydown but give feedback at blur #1325

tgaeta opened this issue Sep 23, 2019 · 2 comments
Labels
status: incomplete Need more information

Comments

@tgaeta
Copy link

tgaeta commented Sep 23, 2019

Environment

Tech Version
@material-ui/pickers 2.2.4
material-ui core@3.4.0
React 16.8.6
Browser Firefox Quantum v.69

Steps to reproduce

Wire up a datepicker and a submit button. The submit button should have a disabled field. When the datepicker has an error, the submit button isn't disabled until I click out of the datepicker; even though the datepicker itself shows an error.

Expected behavior

Expected behavior should be as soon as an error happens, I should be allowed to update the state of whatever I want, not have to wait for an onBlur event or the focus to change.

Actual behavior

When I input an invalid character, I get an immediate error from the datepicker, but I can't piggyback off that to update the state of a button. I've tried using onError on the component, but I cannot update the state of my button to disabled until after the focus is moved from the datepicker.

Live example

onError

@dmtrKovalenko
Copy link
Member

I think it will be fixed by #1426

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 13, 2020

@dmtrKovalenko I don't think that the issue is related to the popup. Looking at the screenshot, the problem seems to be that the UI only takes the error into account on the blur event, not the key event. This lead to an inconsistency in the UI.

I have tried to reproduce with:

No issue. This lead me to believe that the root issue is in @tgaeta's codebase or in v2. I think that it's a good example that we should be aggressively closing issues that don't provide reproduction or using an older version of the library (below v4). Unless we can quickly see what could go wrong.

@oliviertassinari oliviertassinari added the status: incomplete Need more information label Apr 13, 2020
@oliviertassinari oliviertassinari changed the title Can't update state of other components until focus is removed from the datePicker. Validation display at keydown but give feedback at blur Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: incomplete Need more information
Projects
None yet
Development

No branches or pull requests

3 participants