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

Don't apply Input "select on focus" behaviour when app is focused #5379

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

darrenburns
Copy link
Member

@darrenburns darrenburns commented Dec 11, 2024

In the browser for example, an input element will only select its content if I tab to it. If I alt+tab to another app then alt+tab back, it doesn't select everything.

This updates Textual to match this behaviour.

Added

Changed

@willmcgugan
Copy link
Collaborator

I don't think so. At least not currently. But you can find the login in App._watch_app_focus

Added a new argument `from_app_focus` to the Focus event class to indicate whether the focus event was triggered by the application regaining focus or by user interaction within the Textual app. Updated the constructor to initialize this new attribute.
… App regaining focus or whether they're a standard focus.
@darrenburns darrenburns changed the title Command palette dont select on focus Don't apply Input "select on focus" behaviour when app is focused Dec 12, 2024
@darrenburns darrenburns marked this pull request as ready for review December 12, 2024 14:46
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