Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mirrored on Nova: NovaSector/NovaSector#1601
Original PR: tgstation/tgstation#82000
About The Pull Request
Removes event parameter (
e
) fromonChange()
&onDrag()
for 2 reasonssetInterval()
which keeps reusing the event object from that 1 time click and not the event data while dragging thus the data is stale and should be discarded & not passed to userRemoved
suppressFlickering
from Number Input. This was only used by Atmos monitoring console and the comment explaining why it was used was also wrong (there is no such asynchronous call in the back end). What this var did was difficult to understand anyway and after removing its only 1 use we can clean it up with no side effects.Removed
updateRate
. Not used anywhere and a constant of 400ms should be sufficient for most purposes anywayFixes #81995. Dragging the Number Input will only send data to the back end if that value changes & not send the same value every 400ms. Simple logic (compare old value with the new) and yet efficient results, This applies when you hit enter or click outside of the field as well
You can once again drag your mouse anywhere in the window outside the number input field to vary the value by large amounts
Changelog
🆑 SyncIt21
fix: number input dragging will only send payload to backend when its value changes, Same applies when you hit enter or click outside the field, the value must have changed to trigger the back end
fix: You can once again drag your mouse anywhere in the window outside the number input field to vary the value by large amounts
code: removed unnecessary variables(suppressFlickering, updateRate & event object param for handlers) from Number Input
/:cl: