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

Add text input operations #1529

Merged
merged 2 commits into from
Nov 13, 2022
Merged

Conversation

tarkah
Copy link
Member

@tarkah tarkah commented Nov 11, 2022

We're missing operations for manipulating the text input cursor / selection of text.

TODOs example is updated to select_all text when an entry is edited, which is how the impure example used to work.

Comment on lines +353 to +354
/// Produces a [`Command`] that moves the cursor of the [`TextInput`] with the given [`Id`] to the
/// provided position.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's happens if position would be outside range of text? Can be this be prevented by using custom types? That should be documented

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's greater than the number of characters in the text input, it just puts the cursor at the end, which is expected.

@hecrj hecrj added feature New feature or request shell labels Nov 13, 2022
@hecrj hecrj added this to the 0.6.0 milestone Nov 13, 2022
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks preem! Thanks! 🥳

@hecrj hecrj merged commit f5c9f63 into iced-rs:master Nov 13, 2022
@tarkah tarkah deleted the feat/text-input-operations branch November 13, 2022 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request shell
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants