Closed nickslick03 closed 3 months ago
Okay, I cleared localStorage and ran the app, and for the most part it works well, though there were a few issues:
newValue
is. That's weird that it only happens on Safari.Okay so I'm actually seeing the error message now in Safari, the only exception being if the starting balance in localStorage is null when the page is loaded and then it won't show up until you type a number into it and then mess it up because the value just stays null. I just discovered that the weird price issue is just because I had the dining dollars discount turned on and it automatically adjusts the prices. If you want to take a look at the issue of it not seeing an initial null, feel free, otherwise I think it's good to merge.
Although the issue of the error message on the starting balance not showing initially may be more of a feature than a bug...I would be kind of annoyed if I started up an app and it was already giving me error messages, haha. But it is misleading to be able to type nonsense into it and have it still be null without sending an error because no state has been updated. This is not an issue in non-Safari browsers since they won't even let you input non-numbers but for some reason Safari does.
Firstly, I aplogize for not creating a bunch of different inputs, but I'm honesty too lazy and too tired to do that. The fix was to use the onInput event (thanks chatGPT) which fires for any change, and it seems to work. I also made the elements uncontrolled since the outside state handles it pretty much. The input behemoth lives on.
Oh yes I forgot about the onInput event, I think that's actually considered the better event to use for capturing input from a so we're good there. Yes, it's still a behemoth component, but it works and so I think we're good at this point. I'm going to merge.
Big things: