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

[Proposal][Desktop] Let "ESC" key de-select currently selected item #94965

Open
Seirdy opened this issue Dec 9, 2021 · 7 comments
Open

[Proposal][Desktop] Let "ESC" key de-select currently selected item #94965

Seirdy opened this issue Dec 9, 2021 · 7 comments
Labels
a: desktop Running on desktop a: error message Error messages from the Flutter framework a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. P3 Issues that are less important to the Flutter project team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team

Comments

@Seirdy
Copy link

Seirdy commented Dec 9, 2021

Use case

Users expect de-selection to work like it does in other programs.

Selected items (including selected text, widgets, and tab-focused items) all require the mouse to de-select, which is inconvenient. Other desktop programs typically allow de-selecting items with the ESC key.

Proposal

Selected items should be de-selected when a user presses the ESC key. This includes:

  • Selected text
  • Selected (long-pressed) widgets: see screenshot below
  • Tab-focused buttons

pic

I had previously filed a ticket for Fluffychat and was directed to file it here.

I observed the lack of support for ESC deselection on the Linux desktop on Wayland, but I think it should be universal.

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Dec 10, 2021
@danagbemava-nc danagbemava-nc changed the title Desktop: have "ESC" key de-select currently selected item [Proposal][Desktop] Let "ESC" key de-select currently selected item Dec 10, 2021
@danagbemava-nc danagbemava-nc added a: desktop Running on desktop a: text input Entering text in a text field or keyboard related problems passed first triage c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability and removed in triage Presently being triaged by the triage team labels Dec 10, 2021
@HansMuller HansMuller added a: error message Error messages from the Flutter framework f: material design flutter/packages/flutter/material repository. labels Dec 13, 2021
@HansMuller
Copy link
Contributor

Interesting proposal. CC @gspencergoog

@gspencergoog gspencergoog added the P3 Issues that are less important to the Flutter project label Dec 16, 2021
@justinmc
Copy link
Contributor

@Seirdy Could you provide a code sample to reproduce this?

If the selection has caused the focus to change and we can receive the escape key, then I think this could be a straightforward fix by firing something like a DismissIntent.

@Seirdy
Copy link
Author

Seirdy commented Feb 11, 2022 via email

@markusaksli-nc
Copy link
Contributor

markusaksli-nc commented Feb 15, 2022

So aside from #98163 and #84416 what else is missing this? It would be helpful to aggregate places where this doesn't work as expected.

I'm slightly concerned about how far exactly this should go since not everything is consistent on desktop. Would it be fair to expect ESC to de-select selected text? Should it unfocus a focused text field if no text is selected? I'm not sure what the general case is for these but playing around with the browser and my IDE there are conflicting approaches. It's certainly doable by just going through a few checks in EditableTextState.

Also am I missing something or does pressing tab in EditableText just always navigate instead of entering anything?

@justinmc
Copy link
Contributor

Currently tab always moves focus per these shortcuts in WidgetsApp. If you remove/override them, then a tab character will be inserted.

For escape behavior, I think ideally we should match the platform's behavior everywhere we can, with Chrome being the standard for web (I don't think I've seen a case of Flutter changing behavior per-browser). On something like Mac, if there seems to be no consensus for the behavior among apps, probably the standard would be to create a plain text field in a native Mac app in Xcode and see what it does by default.

That may be splitting hairs in some cases but I think that's what we should aim for.

@markusaksli-nc markusaksli-nc self-assigned this Mar 8, 2022
@markusaksli-nc markusaksli-nc removed their assignment Mar 18, 2022
@Seirdy
Copy link
Author

Seirdy commented Jul 7, 2022

This could also be considered an accessibility issue, as failing to de-select an item would violate all three levels of WCAG 2.2's Guideline 2.1 (Keyboard Accessible). One of Flutter's selling points is accessibility; this makes anything that disqualifies it from the WCAG's most lenient conformance level a big deal.

@flutter-triage-bot
Copy link

The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

@justinmc justinmc added the triaged-text-input Triaged by Text Input team label Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop a: error message Error messages from the Flutter framework a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. P3 Issues that are less important to the Flutter project team-text-input Owned by Text Input team triaged-text-input Triaged by Text Input team
Projects
None yet
Development

No branches or pull requests

8 participants