-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Textfield not working #4437
Comments
Are you using 20.19.4 or 20.19.5? If it still happens after the version upgrade, can you please provide a snippet of the text field that you're trying to tap into so we'll be able to reproduce and investigate that? |
Oh, you're the reporter of this issue #4426.
We made a test that (allegedly?) reproduces your issue and it passes with the fix from the patch version 🙁 |
So I just updated to new version and the logs say "passed " but actually there is no insert of any text. Textfield: |
Thanks, I see you're using MUI, I'll check if it might be related. What happens if you change the type attribute to |
Hello |
I'll investigate this. I'll keep you updated, thanks for the report! |
Thanks, |
@alexandravychytill, I was unable to reproduce your issue, as the previous workaround we implemented seemed effective (and underwent testing). Consequently, I opted to bypass the workaround and avoid text selection on input elements that initially don't support |
@alexandravychytill please try the latest version https://github.com/wix/Detox/releases/tag/20.20.1 |
Hello |
@alexandravychytill You can see our test app in this repo: |
Let's try another thing. On the inner-element you're trying to interact with, let's run a custom JS action that changes its value: const inputElement = web.element(by...);
await inputElement.runScript(function get(element) {
element.value = "desired text to type";
}); |
Oh, I think I figured the issue. I believe it doesn't work because the element's value is controlled by React state. If the code snippet I provided in the previous comment doesn't work, please try the following: await inputElement.runScript(function get(element) {
element.value = "desired text to type";
// Dispatch an 'input' event to ensure React's internal state is updated
const event = new Event('input', { bubbles: true });
element.dispatchEvent(event);
}); If it still doesn't work, can you please provide me with the link to the web-page you're trying to interact with? I'll try to debug our mechanism against this page. |
Great this worked now. I just found another bug for iOS, will create a new Bug Issue for that :) |
@alexandravychytill the fix has released with 20.20.2 |
@asafkorem fount interesting thing
with html above await web.element(by.web.id('username')).typeText('asdf') doesn't work but if you add maxLength will be work |
@asafkorem I am on the latest version I tried your workaround ^, and it works, until I focus away from that field. Then, the text disappears. |
@asafkorem i am also in the latest version> I can see the text visually when i focus on another input then the previous input text disappearing , but the test case is passing. |
You might also need to add a bit more if you're pushing events up to a react app
Credit here: StackOverflow |
What happened?
With new release (20.19.5) type text for web textfield not working on iOS. It has no error, but there gets no text inserted.
What was the expected behaviour?
await web.element(by.web.id(elementId)).typeText(text) should actually insert the text
Was it tested on latest Detox?
Did your test throw out a timeout?
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: 20.19.5
React Native version: 0.72.0
Has Fabric (React Native's new rendering system) enabled: yes
Node version: >=16
Device model: iPhone 15
iOS version: 17.2
macOS version: 14.4
Xcode version: 15.2
Test-runner (select one): jest
Detox logs
Detox logs
Device logs
Device logs
More data, please!
No response
The text was updated successfully, but these errors were encountered: