question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cursor starts in wrong position in reset forms

See original GitHub issue

I’m trying to change the ContactForm sample to have an initial value for a name, “foo”. I’m not sure how to do this correctly, and my attempt leads to a problem rendering text boxes.

My naive try to set the default data was to change the call to super for ContactView:

    super(ContactView, self).__init__(screen,
                                      screen.height * 2 // 3,
                                      screen.width * 2 // 3,
                                      hover_focus=True,
                                      title="Contact Details",
                                      reduce_cpu=True,
                                      data={"name": "foo"})

I don’t think that’s correct, though, given that this constructor is called every time the screen is resized and it seems like this might reset the data to the starting value.

If you actually run this you will see that the cursor appears in the middle of the text box but there is no text.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
peterbrittaincommented, Nov 28, 2017

Doh! I meant to check that into master… Sigh.

0reactions
garfieldnatecommented, Nov 28, 2017

Thanks, this fixes some other buggy behavior I’ve been encountering, too. I’ve cherry-picked this into master in my own copy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cursor Appearing in wrong position. - Microsoft Community
I've tried it myself, and by default, when you click New message, the cursor is on the To: field is left indented unless...
Read more >
Wrong Position Cursor after reset Field - bb.donnay-software.com
I made a small program to reproduce the problem. Run the Exe and type 1234. The cursor must always appear aligned to the...
Read more >
C# Cursor Position not in right place in forms - Stack Overflow
You're currently getting the Cursor position. Which is relative to the screen, which is why it is a different offset when you move...
Read more >
Why is my cursor showing up in the wrong place when I try to ...
Same situation, I have Google Docs on iOS and nothing is working to fix the cursor. For me the cursor will overlap other...
Read more >
Cursor jumps to end of controlled input · Issue #955 - GitHub
When an input element is "controlled" by a model, the cursor will jump to the end of the line on every change. This...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found