Closed droud-dev closed 1 year ago
Visit the preview URL for this PR (updated for commit 78e4093):
https://planning-poker-agile--pr59-clear-session-boxes-1at0zjy1.web.app
(expires Fri, 25 Nov 2022 20:11:31 GMT)
🔥 via Firebase Hosting GitHub Action 🌎
Sign: 08d9ba9524ac904b4a5756f358719cca7a9f7e2c
Yea that's weird, looking at the build it seems like the tests errored out, yet the build + tests step passed in the pipeline. The issue was in taking the value
from the state caused the value of the input to be undefined
at the very beginning of the render, which caused React to think that the inputs were unmanaged, which caused the error once there was an attempt to put in the magic names and/or clear them on click. A lotta hoops to jump through 😅
In any case, the test is no longer erroring, and in local dev the fields do get cleared, however it seems that in the built/pipeline version they don't which is weird and I haven't figured out yet why.
Edit: It seems like the deployed version is an old version, since looking at the code it still has defaultValue
on the inputs which has been removed in the PR, hence why it doesn't work in the preview
You are correct, the problem seems to be in preview env. Looks good to me.
This annoyed me sufficiently that after some fiddling, it now automagically clears the default values from the game/player name input boxes when clicked/tapped. Plus, the test for the new functionality.
Note: In Material UI, the
defaultValue
prop for an input is only for unmanaged inputs, but since there's an onchange listener this is not an unmanaged input, hence usingvalue