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

Make text fields yield keyboard focus on "Esc" in a consistent way #19484

Merged
merged 1 commit into from Jul 4, 2021

Conversation

dragunoff
Copy link
Contributor

@dragunoff dragunoff commented Jul 4, 2021

Some text fields were clearing the input on Esc before yielding focus and others were only clearing input (lobby chat field) and others were doing both at the same time (map editor search filter). This PR standardizes this behavior to just yielding focus without clearing the input. There are some special case text fields that I have not touched (player name, map chooser, in-game chat). In the future we may set this behavior as the default for text inputs so that chrome logic doesn't need to implement it.

Closes #15426

@pchote
Copy link
Member

pchote commented Jul 4, 2021

On macOS at least its a standard UI convention to be able to use Esc to clear search fields. I'm not necessarily opposed to removing this, but i wonder if we should think about adding some other quick mechanism to clear search fields? macOS also adds a floating ❎ right aligned inside the field once there is text.

@dragunoff
Copy link
Contributor Author

On macOS at least its a standard UI convention to be able to use Esc to clear search fields. I'm not necessarily opposed to removing this, but i wonder if we should think about adding some other quick mechanism to clear search fields? macOS also adds a floating negative_squared_cross_mark right aligned inside the field once there is text.

I don't mind changing the behavior (Esc clears, then yields if empty) as long as it's consistent across fields.

@pchote
Copy link
Member

pchote commented Jul 4, 2021

That sounds best to me (for search fields only). We could add a search glyph in the left of the field if we want to visually distinguish them from other types of text field.

@dragunoff
Copy link
Contributor Author

That sounds best to me (for search fields only). We could add a search glyph in the left of the field if we want to visually distinguish them from other types of text field.

What about the chat input then? It's not a search field and I want to standardize its behavior too.

@dragunoff
Copy link
Contributor Author

Made some amendments as discussed:

  • search fields clear the input and yield if empty
  • chat field and actor edit field yield without clearing

Copy link
Member

@pchote pchote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise

- search fields clear the input and yield if empty
- chat field and actor edit field yield without clearing
@dragunoff
Copy link
Contributor Author

Update: Addressed review comments.

Copy link
Member

@abcdefg30 abcdefg30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@abcdefg30 abcdefg30 merged commit 64e76e1 into OpenRA:bleed Jul 4, 2021
@abcdefg30
Copy link
Member

Changelog

@dragunoff dragunoff deleted the feature/esc-text-focus branch August 2, 2021 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow players to take screenshots from the menu or to hide it.
3 participants