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

[REF-2789] Graceful deprecation of rx.input.root and rx.input.input #3249

Merged
merged 2 commits into from
May 8, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented May 8, 2024

Handle previously valid code where rx.input.root wrapped rx.input/rx.input.input and rx.input.slot.

Raise deprecation warnings with hints about how to refactor code.

Copy props from rx.input.root to children inputs and apply any rx.input.slot components to children inputs in an attempt to keep existing code working as best as possible.

Fix DebounceInput:

  • pass children through (for rx.input.slots)
  • pass _rename_props through (for color_scheme)

Handle previously valid code where rx.input.root wrapped
rx.input/rx.input.input and rx.input.slot.

Raise deprecation warnings with hints about how to refactor code.

Copy props from rx.input.root to children inputs and apply any rx.input.slot
components to children inputs in an attempt to keep existing code working as
best as possible.

Fix DebounceInput:
  * pass children through (for rx.input.slots)
  * pass _rename_props through (for color_scheme)
Copy link

linear bot commented May 8, 2024

if isinstance(child, (TextFieldRoot, DebounceInput))
]
slots = [child for child in children if isinstance(child, TextFieldSlot)]
carry_props = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the event handlers may also need to be bubbled (based on the integration tests)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, i'm actually surprised that code sample in reflex-web actually worked before... i thought a root always needed an explicit input inside of it, but i guess not. will adjust

Fix for case where `rx.input.root` had no input children
@masenf masenf merged commit 6fb254a into main May 8, 2024
46 checks passed
@masenf masenf deleted the masenf/deprecate-rx-input-graceful branch June 25, 2024 02:21
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.

2 participants