hellomuthu23 / planning-poker

Free Planning Poker app for Agile/Scrum teams to use
https://planning-poker-agile.web.app/
MIT License
174 stars 82 forks source link

Automatically clear the default values of the input boxes #59

Closed droud-dev closed 1 year ago

droud-dev commented 1 year ago

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 using value

github-actions[bot] commented 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

droud-dev commented 1 year ago

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

hellomuthu23 commented 1 year ago

You are correct, the problem seems to be in preview env. Looks good to me.