Skip to content

Properly relinquish activeFocus on ValueInput when editing is finished #255

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

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

jarolrod
Copy link
Member

@jarolrod jarolrod commented Feb 10, 2023

On master, pressing enter while editing a setting that has a ValueInput does not properly relinquish focus from the ValueInput, still leaving it in an editing state. This fixes that by:

a. Making ValueInput a TextInput instead of a TextEdit

  • TextEdit allows for multi-line input, so an enter in this would add a new line, which we don't want. There is no use case for a ValueInput to be multiple lines, it should only be one. Additionally, this prevents enter from signaling that editing is finished
  • TextInput is specifically for single line input. This QML type also allows us to do necessary validations with a validator, inputMask, and signal what kind of keyboard we want with inputMethodHints. Additionally, this allows for enter to signal that editing is finished.

b. Relinquishing focus on the ValueInput itself, by forcing focus back to the parent Setting.

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

There is no use case for a ValueInput that will be fed into a setting
to be multi-line in nature
This gives the focus back to the parent setting, relinquishing focus
on the ValueInput and moving it out of the edit state.
Copy link
Collaborator

@johnny9 johnny9 left a comment

Choose a reason for hiding this comment

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

ACK 90fd65b

@hebasto hebasto merged commit 7b8b81c into bitcoin-core:main Feb 16, 2023
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.

3 participants