Skip to content

Set React's onChange property for input elements if its not provided #1283

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

Conversation

JamesHutchison
Copy link
Contributor

Description

Add onChange to input elements

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

@JamesHutchison
Copy link
Contributor Author

It doesn't seem like there should be any side effects to this change since it is aligning the behavior when on_change is and is not provided

@Archmonger Archmonger changed the base branch from main to develop March 8, 2025 02:12
@Archmonger
Copy link
Contributor

Needs regression tests and fixes for failing tests

@Archmonger
Copy link
Contributor

After some additional thought, I'm going to close this. This PR tricks ReactJS into thinking everything is a controlled input, which negates some safety/guardrails that exist in the React client.

The more healthy solution is to verbosely communicate to the developer that they are utilizing an uncontrolled input when ReactPy is in debug mode:

@Archmonger Archmonger closed this May 31, 2025
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