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

Wrong cursor position in TextInput #2195

Closed
2 tasks done
DaraJKong opened this issue Jan 11, 2024 · 2 comments · Fixed by #2196
Closed
2 tasks done

Wrong cursor position in TextInput #2195

DaraJKong opened this issue Jan 11, 2024 · 2 comments · Fixed by #2196
Labels
bug Something isn't working text widget

Comments

@DaraJKong
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

Sometimes, the cursor position inside of a TextInput is offset from the "real" cursor such that characters are inserted at the wrong place. When clicking on the empty space after the TextInput's value, the cursor appears one character away from the end instead of being at the very end.

Selecting all the text inside of the input and typing some new text removes the issue.

2024-01-11.01-02-51.mp4

It seems to be a visual bug, because typed characters are inserted correctly. However, the cursor is not displayed at the right position.

This issue happened to me several times when using the master branch of Iced in my projects. The crates.io version doesn't have that bug.

To pinpoint exactly what's causing the issue, I tried making an SSCCE:
master...DaraJKong:iced:fix/wrong_text_input_cursor_position
However, it turned out so short that it's almost an Hello World for the TextInput widget.

What is the expected behavior?

Characters should be inserted at the cursor, not offset from it.

Version

master

Operating System

Linux

Do you have any log output?

No response

@DaraJKong DaraJKong added the bug Something isn't working label Jan 11, 2024
@hecrj
Copy link
Member

hecrj commented Jan 11, 2024

Interesting. This seems to be caused by the fi ligature. I'll look into it.

@hecrj
Copy link
Member

hecrj commented Jan 11, 2024

Should be fixed by #2196.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working text widget
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants