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

On iOs APP using native Apple virtual keyboard with "Preditive Text edition", when taping the suggested word the cursor jumps to the end of text. #3851

Closed
JTBrandao opened this issue Oct 25, 2024 · 5 comments · Fixed by #3875
Assignees

Comments

@JTBrandao
Copy link

On iOs APP when typing on native virtual Apple Keyboard with Preditive Text edition: When we tap the "suggested word" the text cursor jumps to final text.

This behavior occours only in iOs. We reproduced it in iOs 17 version.

The images bellow shows such behavior:

Before taping on suggested word: The text cursor is just after the word "comum ".
Captura de Tela Antes

Just After taping on suggested word "que": This word is correctly written on current cursor position, but just after the cursor jumps to the end of the text.

Captura de Tela Depois

Important: The incidence of the problem has a somewhat random behavior: the error does not always occurs, but with some important frequency, when we touch the suggested word, the cursor will jump to the end of the text.

Bellow a simple code of the project:

public class MyApplication {

private Form current;
private Resources theme;

public void init(Object context) {
    theme = UIManager.initFirstTheme("/theme");
    Toolbar.setGlobalToolbar(true);
}

public void start() {
    if(current != null){
        current.show();
        return;
    }
    Form hi = new Form("Samsung Test TextArea", new BorderLayout());
    TextArea textArea = new TextArea();
    hi.add(BorderLayout.CENTER, textArea);        
    hi.show();
}

public void stop() {
    current = getCurrentForm();
    if(current instanceof Dialog) {
        ((Dialog)current).dispose();
        current = getCurrentForm();
    }
}

public void destroy() {
} 
@JTBrandao
Copy link
Author

Anyone else observed this behavior ?
Any guidance or workaround would be welcome.

@shannah
Copy link
Collaborator

shannah commented Feb 22, 2025

This is fixed and will be included in the next release on Friday, February 28th

@DurankGts
Copy link
Contributor

I thinks that this issue is causing that when I receive a sms token in ios side and I select the token from the native keyboard my app is crashing.. please check this issue because this problem was not passing.
this the crashing log in IPHONE 13 ios 17.4.1

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Reason: -[%s selectedRange]: unrecognized selector sent to instance 0x105027a00
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: MyappName [416]

Triggered by Thread: 0

there is a way to disable this preditive until you solve the issue? how que can I disable general preditive text Edition

@shai-almog shai-almog reopened this Mar 6, 2025
@shai-almog
Copy link
Collaborator

@shannah I think we need to surround the code with:

if ([textView respondsToSelector:selectedRange]) {
    ...
}

@shannah
Copy link
Collaborator

shannah commented Mar 6, 2025

Fixed #3878

@shannah shannah closed this as completed Mar 6, 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 a pull request may close this issue.

4 participants