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.

MaskedInput not registering input in React 16.4

See original GitHub issue

Environment

Tech Version
material-ui-pickers 1.0.0-rc.10
material-ui 1.2.1
React 16.4.1
Browser N/A
Platform N/A

Steps to reproduce

  1. Create a DatePicker with mask with React 16.4.1
  2. Attempt to type in the box.

Expected behavior

When I type into input the value should register.

Actual behavior

Value is being cleared immediately thus appearing as if the input is readonly.

Live example

https://codesandbox.io/s/wnljy6rkok

Notes: I reported a similar issue on the Formik library as well. Without digging into it much, my hunch is that it may be related to the changes to getDerivedStateFromProps in React 16.4 where this now fires on every render.

Also note, this does work if you choose a date first from the picker. This also works using React 16.3.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

3reactions
TioRubencommented, Jun 21, 2018

Ok, I guess @nzacca issue and (@waclock && me) issue are different. Ours is fixed with your PR, but the codesandbox example from @nzacca has a different behaivour than we experienced.

3reactions
waclockcommented, Jun 20, 2018

I’m currently facing a similar issue. I tried downloading the docs project (the website where the docs are stored), and if I try using the options mask + keyboard, when I click on the calendar option and then click “OK”, the input value won’t update, even though I can see the state of the component did change. I could not get the DatePicker with mask + keyboard to work, neither with React 16.4.1 nor 16.3.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MaskedInput not registering input in React 16.4 #475 - GitHub
I'm currently facing a similar issue. I tried downloading the docs project (the website where the docs are stored), and if I try...
Read more >
Not working onChange in react-input-mask (custom input)
I am not using any libraries as input, but for some reason onChange dont work... <InputMask onChange={(e) => console.log(e.target ...
Read more >
React Hook Form with InputMask - CodeSandbox
Activating extension 'vscode.typescript-language-features' failed: Could not find bundled tsserver.js.
Read more >
[InputMask React] Input mask text not working when hebrew ...
Hello guys. I need some help because of the patterns a: alphabetical or *: alphanumeric in any of those cases I'm able to...
Read more >
@types/react-input-mask - npm
Start using @types/react-input-mask in your project by running `npm i @types/react-input-mask`. There are 77 other projects in the npm ...
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