tablelandnetwork / studio

Discover, design, deploy, and manage data driven web3 apps on Tableland.
https://studio.tableland.xyz
4 stars 1 forks source link

fix: form validation & submission #248

Closed dtbuchholz closed 6 months ago

dtbuchholz commented 6 months ago

Summary

Form inputs weren't being validated and could no longer be sumbitted (registering username, tables, proj, etc.). If you log the debouncedValue in handleInputChange, it was never updating and always undefined/empty. In this fix, updateQuery is called directly when the timeout expires, and debouncedValue is removed to focus directly on using inputValue for the query update (vs. value).

vercel[bot] commented 6 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
studio ✅ Ready (Inspect) Visit Preview Apr 12, 2024 2:56am
dtbuchholz commented 6 months ago

@asutula i'm not quite sure how all of the debouncing logic and whatnot works—this was mostly chatgpt helping me through it, and this end result fixed the bug 🤷

asutula commented 6 months ago

Is there some special way to reproduce this, or it's simply that the forms are completely broken?

dtbuchholz commented 6 months ago

@asutula forms completely broken, can't use any of them. I think it's because the debouncedValue never gets updated, so the validation checks never occur, so the form doesn't "see" any changes. Something like that.