Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The default_value set in the input component in debounce_input does not work. #3195

Open
Evenzel opened this issue Apr 30, 2024 · 1 comment
Labels
wontfix This will not be worked on

Comments

@Evenzel
Copy link

Evenzel commented Apr 30, 2024

Describe the bug
The default_value set in the input component in debounce_input does not work.

To Reproduce
Steps to reproduce the behavior:

rx.debounce_input(
    rx.input(
        default_value='tomato'
        on_change= Anystatefunction
    ),
),

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Specifics (please complete the following information):

  • Python Version: 3.11.4
  • Reflex Version: 0.4.9
  • OS: Windows 10
  • Browser (Optional): Chrome

Additional context
Add any other context about the problem here.

@picklelo picklelo added the bug Something isn't working label May 1, 2024
@Lendemor
Copy link
Collaborator

Lendemor commented May 3, 2024

The debounce component we are using "react-debounce-input" does not support defaultValue so it's not really a bug, just an unsupported feature. (and the lib has no update in last 2 years so unlikely they will add this.)

There is little we can do on our side aside from replacing the component for a better one, if there is one.

On the other hand, there is no reason to use rx.debounce_input if you are not in fully-controlled mode (where default_value doesn't make sense).

Instead, for situation where you want debounce but not setting the value props, on latest main /0.5.0 you can do :

rx.input(
    on_change=TestState.set_num.debounce(1000),
    placeholder="your number",
    default_value="5",
),

@Lendemor Lendemor added wontfix This will not be worked on and removed bug Something isn't working labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants