Skip to content

[RUM-11283] Improve Babel Plugin support for TextInput component #957

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

cdn34dd
Copy link
Contributor

@cdn34dd cdn34dd commented Aug 11, 2025

What does this PR do?

While the Babel plugin already supports TextInput automatic wrapping, it only does so when users define the onFocus attribute, which is the same behavior we have for other elements, like buttons.

The main different here, is that for buttons having an onPress attribute is essential for the basic functionality, while on TextInputs, the main functionality comes from the onChangeText attribute.

So when onFocus is not present, we should make the babel plugin add it so our wrapping logic works even if the user’s code does not include it.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

Ensure `onFocus` attribute is added if not present already, so our
wrapping logic can happen.
@cdn34dd cdn34dd requested a review from a team as a code owner August 11, 2025 09:08
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