Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset executed on "Enter" #62

Closed
kantenkugel opened this issue Apr 11, 2020 · 2 comments · Fixed by #67
Closed

Reset executed on "Enter" #62

kantenkugel opened this issue Apr 11, 2020 · 2 comments · Fixed by #67

Comments

@kantenkugel
Copy link
Contributor

When entering the current price, I accidentally hit enter in an attempt to "submit" the value.

This sadly triggered the reset functionality, as it seems to try and submit the values with the next button (Reset Turnip Prophet)

It would be good to somehow prevent the enter event or to add some confirmation dialog

@kantenkugel
Copy link
Contributor Author

kantenkugel commented Apr 11, 2020

Probably the easiest solution would be to move the button outside of the form, since a form automatically tries to submit via first button available, once enter is hit on one of its inputs

Edit: actually, just adding type="button" to the button would do the trick, since it is then no longer considered valid for submission of the form

@theRTC204
Copy link
Collaborator

Oh, this must have been a regression introduced when the new UI was pushed. This was previously fixed before then.

sentoren added a commit to sentoren/ac-nh-turnip-prices that referenced this issue Apr 12, 2020
* Add support to remember prices in hash parameter.

This makes linking to a particular price chart easier.

* Change from hash to query string.

* Catch exception locally.

* Don't override localstorage when there's query string.

* Refactored scripts.js

Scripts.JS was very hard to read initially.

This commity cleans things up, abstracts functions, and makes it a bit more easier to read.

* fix: Fix UI issue

* More fixes

* feat: Add toggle for filtering results to first ever buy

* Undo unrelated style changes.

This should be done in another PR :P

* Undo more unrelated style change.

* Undo one more unrelated change.

* feat: display %chance of each pattern if known

* Rename pattern and make probability per row

* Fix calculations

* Add 'LeastMax' Parameter

Add additional logic to compute 'LeastMax', which represents the worst case scenario maximum price achievable during the week (assuming everything is sold on the correct day).

* Remove minimum, rename other field to guaranteed minimum

* Readable dynamic length querystrings

This adjusts the current querystring read to allow for shorter, more readable querystrings

* Squashed commit of the following:

commit efffda8
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 19:03:49 2020 -0400

    Fixed Reset Button

    Fingers crossed on last commit

commit ff6b739
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 18:49:54 2020 -0400

    Copy Update + Radio Button Fix

    Changed the copy under "First-Time Buyer" and made the selected radio button a solid fill rather than only coloring the text.

commit 95887a6
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 18:31:18 2020 -0400

    Removed a Console Log

commit 84f1ef8
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 18:27:03 2020 -0400

    Added Probabilities

    Chart will now also display % chance of that pattern.

commit d047d77
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 18:08:35 2020 -0400

    Added "First Buy" and "Previous Pattern"

    All CSS needed for these fields have also been included, as well as some Javascript updated to reflect the new radios.

commit 95b60e1
Merge: 1d6046b be09f8e
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 13:51:53 2020 -0400

    Merge branch 'front-end'

commit be09f8e
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 13:51:43 2020 -0400

    Requested changes

    This commit adds changes as requested in mikebryant#34

commit 1d6046b
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 02:34:12 2020 -0400

    typo

commit a414b8f
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 02:22:36 2020 -0400

    Update scripts.js

commit fbc3878
Merge: d521944 3cad0d4
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 02:18:57 2020 -0400

    Merge branch 'master' of https://github.com/Trevor-Welch/ac-nh-turnip-prices

commit d521944
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Wed Apr 8 02:15:37 2020 -0400

    Massive UI Rework

    This commit completely changes the UI of the app, giving it a more Animal Crossing touch and make it feel like an app on the Nook Phone.

commit 3cad0d4
Author: Trevor Welch <welch.trevor@yahoo.com>
Date:   Mon Apr 6 20:43:38 2020 -0400

    Refactored scripts.js

    Scripts.JS was very hard to read initially.

    This commity cleans things up, abstracts functions, and makes it a bit more easier to read.

* fix: Retain compatibility with previous stored data

* fix: Fix reset button

* fix: Reduced overall element size throughout UI

* fix: Improved data table visibility on different devices

This change introduces new behavior for the data table.

If the device supports a fine pointer (mouse or touchpad) and a screen
width that is less than 1400px, we will set a max height on the table
allowing the horizontal scroll bar to be easily accessable.

If the device supports a coarse input (touch) we will not set a max
height on the table, because horizontal scrolling is a simple swipe.

If the device has a screen that is wider than 1400px we will not set a
max height on the table, as there would not be a horizontal scroll bar.

* Update to provide consistent cross-browser behavior.

Changes the sorting in `generate_possibilities` to have the intended effect. The old version worked on firefox, but did not sort the list on chrome because `a.weekMax < b.weekMax` does not return `-1` if `a.weekMax > b.weekMax`.

* Change reset Button to type button

This avoids being able to accidentally reset the form by pressing enter in one of the input fields

Solves mikebryant#62

Co-authored-by: Pi-Hsun Shih <pihsun@chromium.org>
Co-authored-by: Trevor Welch <welch.trevor@yahoo.com>
Co-authored-by: Mike Bryant <mike@mikebryant.me.uk>
Co-authored-by: Ryan Carbotte <ryan@boldcommerce.com>
Co-authored-by: Peter Shih <peter50216@gmail.com>
Co-authored-by: Lou Huang <lou@louhuang.com>
Co-authored-by: jtplatt99 <jonathantplatt@gmail.com>
Co-authored-by: Tyler Matchett <tyler@pixelget.net>
Co-authored-by: Phoenix Meadowlark <40036383+phoenix-meadowlark@users.noreply.github.com>
Co-authored-by: Michael Ritter <ritter.michael92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants