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

fix: writeText action only writing one character on iOS and Android #387

Open
k-ane opened this issue Jan 7, 2024 · 5 comments
Open

fix: writeText action only writing one character on iOS and Android #387

k-ane opened this issue Jan 7, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@k-ane
Copy link

k-ane commented Jan 7, 2024

I've only tested on iOS and Android simulator, but in both cases write text would only write one character, this was using the example provided by Fluttium as well.

The way I was able to work around this for now was to duplicate the action and write the whole text in one go instead of letter by letter, but a better solution should be found.

@override
  Future<bool> execute(Tester tester) async {
    TextInput.setInputControl(_textInputController);
    tester.emitPlatformMessage(
      SystemChannels.textInput.name,
      SystemChannels.textInput.codec.encodeMethodCall(
        const MethodCall('TextInputClient.requestExistingInputState'),
      ),
    );
    TextInput.restorePlatformInputControl();

    // Temporary workaround, enter whole text instead of character by character
    await _enterText(tester, text);
    await tester.pumpAndSettle();

    // for (final char in text.split('')) {
    //   await _enterText(tester, char);
    //   await tester.pumpAndSettle();
    // }
    return true;
  }
@k-ane k-ane added the bug Something isn't working label Jan 7, 2024
@Dustec
Copy link

Dustec commented Apr 2, 2024

Can you share the full code if this work around?

@mskhan18
Copy link

@k-ane were you able to fix this issue? Because I also have this issue

@alejandro-rios
Copy link

I have the same issue in a Flutter web project, the weird thing is that I downloaded the fluttium repo, run the text_flow example and happens the same

@Dustec
Copy link

Dustec commented Aug 16, 2024

I talked to the developer by discord about this. Is a known issue that they are not going to fix soon.
I would recommend you use another approach.
I used patrol once and it's great 😄

https://patrol.leancode.co

@alejandro-rios
Copy link

I talked to the developer by discord about this. Is a known issue that they are not going to fix soon. I would recommend you use another approach. I used patrol once and it's great 😄

https://patrol.leancode.co

Thanks, but according to this, they are not supporting flutter web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants