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

Focus on CheckBox #3822

Merged
merged 13 commits into from
Jul 18, 2024
Merged

Focus on CheckBox #3822

merged 13 commits into from
Jul 18, 2024

Conversation

ImmediandoSrl
Copy link
Contributor

Good morning, i'm trying to implement focus on checkbox component with TAB on physical keyboard.
Debugging code i see that when i press TAB on my Device with physical keyboard from TextField to CheckBox it doesn't work.

It only works switching from a TextField to another, because of this code on Runnable onEditorAction in InPlaceEditView class (line 1233)
if (next != null && next instanceof TextArea) {
nextTextArea = (TextArea) next;
}

Adding fNext.requestFocus(); it works fine. is possible to publish this request or suggest me another way to do that?

@shai-almog
Copy link
Collaborator

As far as I can read the change you're requesting focus to the next component while processing an action in the currently editing component. This can have multiple edge cases and problems that impact everyone and also doesn't seem like the right thing. A change like this should be handled for the tab key only, not for everything.

As a side note the indention for both lines modified is inconsistent with the rest of the code making it harder to read.

@ImmediandoSrl
Copy link
Contributor Author

Good morning, I modified my pull request now the component will only request focus if the TAB key was pressed

@shai-almog shai-almog merged commit f359bfd into codenameone:master Jul 18, 2024
@shai-almog
Copy link
Collaborator

Thanks.
I merged this. But notice that the indentation is still broken. You can see it in the diff here:
https://github.com/codenameone/CodenameOne/pull/3822/files/81d2dd9623676ab20c62105b71bf06286f4b9e41..0851bd3ab92e6504dc80d8086ae244e2d865530f

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