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

Allow fill_in to work with reactjs #2653

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iainbeeston
Copy link

React overrides the native setter of html input elements, so it doesn't fire change events when the value is changed. Because of that, for those input types where capybara uses javascript to change the value, change events are not fired as you'd expect when using react.

I've updated the code to use the un-overridden value setter instead as recommended here:

https://stackoverflow.com/a/46012210

I believe this shouldn't adversely affect apps using other javascript frameworks or no frameworks at all

React overrides the native setter of html input elements, so it doesn't fire change events when the value is changed. Because of that, for those input types where capybara uses javascript to change the value, change events are not fired as you'd expect when using react.

I've updated the code to use the un-overridden value setter instead as recommended here:

https://stackoverflow.com/a/46012210

I believe this shouldn't adversely affect apps using other javascript frameworks or no frameworks at all
@twalpole
Copy link
Member

twalpole commented Apr 3, 2023

I think this is a bit too risky to make the default immediately - may provide it as an optional behavior

@iainbeeston
Copy link
Author

My biggest issue is how to test this, do you have any advice for that?

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.

None yet

2 participants