h2oai / h2oai/nitro

required=True does not enforce field value existence

Open
#8 1 comment 0 reactions 1 assignee Claimed by @lo5 View on GitHub
area/ui type/bug
Dominant language
TypeScript
Stars
202
Forks
10
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

`box('input something', required=True)` does not seem to actually require a value. It just adds a red asterisk above the text input, but when the "continue" button is clicked, the form submits with no value (or with an empty value?)

**Expected behavior**

Much like the native text input in modern browsers, provide a tooltip to the user saying "this field is required" or "{NAME} is required".

**Actual behavior**

The form submits without a value.

**To Reproduce**

Modify the hello world example, change one of the box line to:

```python
feel = await view(box(f'How do you feel today, {name}?', mode='text', required=True))
```

Run this example and click all the "continue" buttons without typing anything into the text inputs.

**Screenshots**

I did not take any sceenshots.

**Environment (please complete the following information):**
- Nitro version: 0.9.0
- Python version: 3.10.4
- OS and version: macOS 12.4
- Browser and version: Vivaldi 5.2

**Additional context**

None.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.