Closed rauloaida closed 9 months ago
Hey, this error looks like something that can be happening if your application is not wrapped with Reshaped provider, can you check if that's the case?
Yep, it's wrapped. Here's the implementation in the minim reproducible example: https://github.com/rauloaida/autofill-bug/blob/main/src/app/page.tsx
Trying to reproduce it here but can't make it throw an error. Does it still happen for you there? https://codesandbox.io/s/quizzical-germain-82r88g?file=/src/App.tsx
Seems to do it for me in the sandbox too. I opened a incognito tab just in case. It also happens on other machines/users that tried this on my team.
Got you. Can't reproduce this yet but I think this means that in some cases handleKeyUp
can get triggered without the correct event. I'll release a patch for this later today and going to let you know so you can confirm it works, thanks for the heads up!
Turns out browsers trigger keydown/keyup events when you're clicking on the autocomplete with your mouse. In that case event.key
is undefined. I've added additional checks to prevent the errors from happening in that case. Going to release a patch with the fix and share here once it's live. Looking at one more issue reported to resolve them together
Released 2.4.2 with the changes, can you check if it works as expected for you now?
This fixed it! amazing, thank you!
Summary: when using the reshaped.so TextField component in a Next.js project, an error is thrown every time the users selects an autofill value pre-stored in their browser. Happens across both Chrome & Safari. Issue is persistent from Reshaped v2.0.3 to v2.3.2.
Steps to replicate:
npm install
&&npm run dev
.Versions: