This PR simply improves the existing settings slider component by allowing users to directly input a slider's value. Previously, users would only interact with the slider via dragging the handle. Now, they have the option to either input the value manually through a text input or continue using the slider in the traditional manner. This improves user experience when interacting with the settings slider if precision is needed, or if the user prefers to input the intended value directly.
A new utility function adjustValueToStep has been added to make sure the inputted values are within a valid range and adhere to the set step size.
The current default behaviour (i.e., not allowing manual input) is maintained if the prop canEditSliderViaInput is explicitly set to false. I've set it to true by default.
Description
This PR simply improves the existing settings slider component by allowing users to directly input a slider's value. Previously, users would only interact with the slider via dragging the handle. Now, they have the option to either input the value manually through a text input or continue using the slider in the traditional manner. This improves user experience when interacting with the settings slider if precision is needed, or if the user prefers to input the intended value directly.
Before:
https://github.com/anse-app/anse/assets/12883356/2ebd393a-3250-456b-a42c-74240760a53c
After:
https://github.com/anse-app/anse/assets/12883356/d2aaa535-fa62-4e20-b9e7-7c2c45f777e3
Linked Issues
No linked issues.
Additional context
canEditSliderViaInput
is explicitly set to false. I've set it to true by default.