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

Focusing Input widget should not move cursor to the end #4823

Closed
darrenburns opened this issue Jul 30, 2024 · 3 comments · Fixed by #4773
Closed

Focusing Input widget should not move cursor to the end #4823

darrenburns opened this issue Jul 30, 2024 · 3 comments · Fixed by #4773
Assignees
Labels
good first issue Good for newcomers

Comments

@darrenburns
Copy link
Member

darrenburns commented Jul 30, 2024

When the Input widget is focused, the cursor currently moves to the end.

This leads to a flickering effect when it's focused via a click, as the cursor jumps to the end (due to the focus handler), and then jumps to the click location (due to the click handler).

Desired behaviour: When the Input is focused via keyboard, the cursor moves back to the position it was previously at the last time it was focused. When focused via click, it goes directly to the click location without jumping to the end first.

@darrenburns darrenburns added the good first issue Good for newcomers label Jul 30, 2024
@TomJGooding
Copy link
Contributor

TomJGooding commented Jul 30, 2024

Desired behaviour: When the Input is focused, the cursor moves back to the position it was previously at the last time it was focused.

Sorry just to clarify, do you mean that the cursor shouldn't move to the click location? Or rather just prevent this flickering effect?

@darrenburns
Copy link
Member Author

darrenburns commented Jul 30, 2024

It should move to the click location. It just should never jump to the end on focus unless that's where the user clicks.

I've updated the description.

Copy link

github-actions bot commented Aug 5, 2024

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants