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

Ctrl+A doesn't select all text in a TextBox #1854

Closed
CryZe opened this issue Jul 4, 2021 · 7 comments · Fixed by #1931
Closed

Ctrl+A doesn't select all text in a TextBox #1854

CryZe opened this issue Jul 4, 2021 · 7 comments · Fixed by #1931

Comments

@CryZe
Copy link
Contributor

CryZe commented Jul 4, 2021

It seems like an implementation along those lines needs to be added, but I'm not 100% sure how to do this correctly. usize::MAX is certainly wrong and I'm not at all sure how IME works, which is the unused return type. Also I've seen that EditSession also just straight up has do_action which can handle TextAction::SelectAll, among all the others. So is there some duplication going on already with the other actions?!

https://i.imgur.com/4ymt5UJ.png

@cmyr
Copy link
Member

cmyr commented Jul 5, 2021

This is supposed to be handled at the IME level. On platforms that don't currently have 'real' ime, you might take a look at the simulate_input method in druid-shell/src/text.rs; here you can handle ctrl+A and dispatch SelectAll to the active text field.

@CryZe
Copy link
Contributor Author

CryZe commented Jul 5, 2021

It already receives SelectAll, but SelectAll doesn't do anything on TextBoxes. Although it doesn't receive it from simulate_input and instead from fallback_do_builtin_command.

@cmyr
Copy link
Member

cmyr commented Jul 5, 2021

do you mean SELECT_ALL command, or text::Action::SelectAll?

@CryZe
Copy link
Contributor Author

CryZe commented Jul 5, 2021

oh I meant SELECT_ALL. Seems like that's different from SelectAll. Why is it so different from Ctrl+C, V, R and co.?

@cmyr
Copy link
Member

cmyr commented Jul 5, 2021

yea, it's fiddly. SelectAll is a special text event in macOS, but copy/paste are not.

@cmyr
Copy link
Member

cmyr commented Jul 5, 2021

I think that probably SELECT_ALL shouldn't be part of fallback_do_builtin_command, it should always be handled by the text system. 🤔

@PoignardAzur
Copy link
Collaborator

In any case, this still happens. I can't Ctrl+A the text in the Textbox example.

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.

3 participants