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

Maximum update depth exceeded #291

Open
allaniftrue opened this issue Jul 14, 2022 · 15 comments
Open

Maximum update depth exceeded #291

allaniftrue opened this issue Jul 14, 2022 · 15 comments

Comments

@allaniftrue
Copy link

Hi,
Anyone encountered this issue?

Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

@osterreich
Copy link

osterreich commented Jul 15, 2022

Facing the same issue only when trying to use autofill in Chrome for iOS.
On all desktop browsers as well as on Android everything works fine.

@yilunc
Copy link

yilunc commented Jul 26, 2022

Same here, but when trying to call form.resetFields() with AntD forms

@ffurkk
Copy link

ffurkk commented Aug 11, 2022

I also have same problem, it's crashing when trying the use autofill in chrome at ios device

@azamatsmith
Copy link

I'm also having this issue when refilling a form with previously entered data.

@apolaert
Copy link

I also have same problem with props "children" used with Input component of antd

@Revolt9k
Copy link

Revolt9k commented Sep 7, 2022

I also have same problem with custom input based on MUI TextField. Problem crash app on focus.

@hahatulk
Copy link

fix please

@hahatulk
Copy link

hahatulk commented Oct 14, 2022

i found temporary fix, you need to define value to string always, do not allow null or undefined

<InputMask .... value={props?.value ?? ""}> .... </InputMask>

@danielhusar
Copy link

The above fix doesnt work for me, so I had to fork the repo and patch it.
This is the change that works for me: #309

@ethanrcohen
Copy link

Was seeing this issue as well in our production application as well, although from logging, it seems to have stopped occurring about four weeks ago. My guess is that this chrome release may have fixed the issue as I'm unable to replicate it now

@danielhusar did you see this resolve itself also? curious why you closed the PR linked above

@Ryanjso
Copy link

Ryanjso commented Jun 15, 2023

We're having this issue on latest version of chrome mobile when autofilling

@danielhusar
Copy link

Was seeing this issue as well in our production application as well, although from logging, it seems to have stopped occurring about four weeks ago. My guess is that this chrome release may have fixed the issue as I'm unable to replicate it now

@danielhusar did you see this resolve itself also? curious why you closed the PR linked above

I closed it as I dont think its will get merged. The repo looks unmaitaned.
We are manually patching the library with fix in my PR to fix it for us.

@Ryanjso
Copy link

Ryanjso commented Jun 15, 2023

Switched my phone inputs over to https://github.com/uNmAnNeR/imaskjs/tree/master/packages/react-imask and it works flawlessly. Mobile autocomplete works great too.

@fred-boink
Copy link

Also experiencing the crash, @sanniassin can you validate @danielhusar fix and update the package?

@joelsantosjunior
Copy link

I fixed this problem using an immediate timeout to postpone the change/render.

mask={mask}
value={initialValue}
...
onChange={(event) => {
  const { value } = event.target;
  setTimeout(() => {
    onChange(value);
  });
}}

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

No branches or pull requests