reflex
reflex copied to clipboard
Input missing step attribute
Describe the bug A clear and concise description of what the bug is. rx.input does not support the step attribute
step attribute: https://www.w3schools.com/tags/att_input_step.asp
To Reproduce Steps to reproduce the behavior:
- Code/Link to Repo:
rx.input(type="number",step="any",placeholder="10" )
The above code produces:
<input spellcheck="false" placeholder="10" type="number" title="" id="radix-:r2n:" name="number" class="rt-reset rt-TextFieldInput">
Expected behavior
A clear and concise description of what you expected to happen.
The code should produce
<input spellcheck="false" placeholder="10" step="any" type="number" title="" id="radix-:r2n:" name="number" class="rt-reset rt-TextFieldInput">
Screenshots If applicable, add screenshots to help explain your problem.
Specifics (please complete the following information):
- Python Version: Python 3.11.5
- Reflex Version: 0.5.10/ 0.6.0a1
- OS:
- Browser (Optional):
Additional context Add any other context about the problem here.
Its also missing the autocomplete attribute rx.input(type="number",autocomplete="off",placeholder="10" ) produces
it should produce
mm, I see. the input component doesn't support these out of the box, I think you would want to try rx.el.input instead. This uses vanilla html
@ElijahAhianyo it looks like rx.input inherits from rx.el.Div - should we instead make it subclass rx.el.Input? I don't remember why we didn't, is it because the Radix input doesn't support all the props of a normal input?
I would like to work in this issue.Can i proceed with it?
@Joodith just assigned you. I believe the change may be switching the rx.el.Div to rx.el.Input as the parent class. Though perhaps this has some unintended consequences, since I'm not sure why we didn't do this initially.
I would like to work on this issue can I have it ?
@abhinav7289A Iam currently working on this.
@picklelo Is it ok to keep the base class as Input instead of Div because currently the TextField class which inherits Div, only has properties relevant to text type field and not numbers.It does not have any property relevant to numbers.Should we have a separate class for numbers or will the simple base class change would do?
@Joodith You can try to swap the base class from rx.el.Div to rx.el.Input, but you'll need to make sure that it's also working when the input is controlled (if you set value AND on_change)
When controlled, the Input will instantiate as a DebounceInput internally, and I'm not sure that DebounceInput actually support step.
@Lendemor Raised pull request.
@Lendemor I saw that few tests in reflex-web integration tests are failing.Should I consider more changes if needed or is it expected one?
Hi guys is there a quick workaround for this to add temporarly rx.el.input but maintain at least the radix style classes?