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

Fix 'enter_key_submit=True' on 'rx.text_area' by carrying custom_code on debounce #4142

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Oct 9, 2024

Alternative to #4084

  • Allow debounce to carry any custom code defined in the child component
  • Move special behavior handling to create classmethod to allow carrying of added props when wrapped in debounce (which does not call _render on the child component).

I think this is preferable to the original patch, because it still allows the debounce to work, avoiding typing jank, and it also works with auto_height behavior.

Fix #4080

Include _get_all_hooks when rendering the child element, instead of just
internal hooks.
Move special behavior handling to `create` classmethod to allow carrying of
added props when wrapped in debounce, which does not call `_render` on the
child component.
@TimChild
Copy link
Contributor

TimChild commented Oct 9, 2024

@masenf, Works great in the test cases I was using for text areas!
Also, definitely better to take this approach. I was doing more testing this morning and realising how janky things get once it's not running locally!

On a related note. How hard would it be to make the DebounceInput work for the rx.slider as well?
For the slider, rx.set_value doesn't work, so I think there is currently no way to be able to use and set slider values without having a slow value/on_change combo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enter_key_submit doesn't work for rx.text_area if value is set (works for rx.el.textarea).
2 participants