Open Tecfan opened 3 years ago
This is so annoying :(
As long as this number is "0", aka nothing is marked, the "Set" button should not be possible to click.
The Set
button begins with the disabled attribute. If counter is >0, remove disabled attribute. Would this address the issue?
I believe so. The counter goes up regardless of what collection you are editing and thus this would work for all the Set buttons
Although all of the source code isn't on this repo, I think this could be done with javascript only, and that means, anyone can contribute to the solution: https://github.com/bartervg/barter.vg/blob/develop/js/utils.js
To improve re-usability, I can add data- attributes to the HTML (set button and counter) to use instead of id or name. I've found that using the latter two attributes makes the javascript more difficult to use for other purposes.
Rather than default to disabled in the HTML, the javascript could toggle between disabled if <= 0, and not disabled if > 0.
What problem does this feature address?
Often I spend 15 seconds adding trading tags, and then I click "Set" either without marking the tradable that I wanted to edit, or accidentally clicking "Set" instead of "Add Another Tradable". All my work is then lost. The page refreshes for no reason with nothing happening.
Describe a solution
The "Set" button next to tradables or other collection items on /i/ pages should be disabled until a valid input is added.
Examples of similar features