nickslick03 / messiah-meal-planner

1 stars 0 forks source link

Calculations and input #33

Closed nickslick03 closed 3 months ago

nickslick03 commented 3 months ago

Big things:

cdrice26 commented 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:

nickslick03 commented 3 months ago
cdrice26 commented 3 months ago

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.

cdrice26 commented 3 months ago

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.

nickslick03 commented 3 months ago

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.

cdrice26 commented 3 months ago

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.