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

TextInput cursor locks to right side of widget when start of text is not on screen #1285

Open
2 tasks done
mtkennerly opened this issue Mar 14, 2022 · 1 comment
Open
2 tasks done
Labels

Comments

@mtkennerly
Copy link
Contributor

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?

When there's too much text to fit on screen at once, after scrolling so that the start of the text is no longer visible, the cursor stays stuck to the right side. This makes it harder to read/edit (you can't scroll to a particular word and edit the middle while the whole word is visible), and it leads to some odd behavior when clicking/dragging (dragging left will very quickly scroll all the way back until the start is visible).

This happens both with master (a53fa91) and with 0.2.0.

IHkS4eS5Al.mp4

What is the expected behavior?

  • The cursor can freely move in the visible range without scrolling/changing the visible text.
  • The visible range only moves when the cursor hits the left or right edges.
MvLaNnMAcv.mp4

Version

master

Operative System

Windows

Do you have any log output?

No response

@mtkennerly mtkennerly added the bug Something isn't working label Mar 14, 2022
@hecrj
Copy link
Member

hecrj commented Mar 15, 2022

Yes! This is a missing feature. There is a TODO in the text_input module that mentions it:

// TODO: Add stateful horizontal scrolling offset

The main challenge is making the horizontal offset "fault-tolerant" (like the Cursor position), given that the value of the TextInput can completely change between view calls and the State has no way to know about it.

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

Successfully merging a pull request may close this issue.

2 participants