h2oai / h2oai/wave

Add precision attribute to spinbox

Open
#1,837 0 comments 0 reactions 0 assignees View on GitHub
feature ui
Dominant language
Python
Stars
4.3k
Forks
371
Avg merge
26d 1h
Merged PRs (30d)
1

Description

via @ledell

### Discussed in https://github.com/h2oai/wave/discussions/1827

Originally posted by **ledell** February 10, 2023
I can't find a form input field that looks like it's good for floats. The [spinbox](https://wave.h2o.ai/docs/widgets/form/spinbox) seems useful for integers, but the only thing I can find for float input would be the [textbox](https://wave.h2o.ai/docs/widgets/form/textbox), and then convert to a float on the backend. Just wanted to check if there's a better built-in solution available.

If there's not something available, maybe we could make a new field type called floatbox which is a wrapper for a textbox that verifies that the input is a float.

### Description

`ui.spinbox` currently allows controlling the precision via the `step` attribute which is not very intuitive. Let's add a new optional `precision` attribute to solve this. If not specified, it should default to the value of `step` to not break the existing apps.

Contributor guide

Open the contributing guide

Research direction

Start with the ui.spinbox implementation and its existing step attribute, then check the linked spinbox documentation and discussion for the intended behavior. Done means an optional precision attribute controls displayed precision and defaults to step when omitted, without breaking existing apps.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.