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

Highlight the text in ValueField when shouldResetOnInsertion is enabled #160

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

achernenko-pp
Copy link
Contributor

@achernenko-pp achernenko-pp commented Sep 10, 2020

Background

shouldResetOnInsertion is a flag that was recently added to ValueField. If enabled, the field value will be cleared before inserting text (see #152 for details).

What has been done?

This PR adds a new behavior: the field value is marked with style.textHighlightColor when shouldResetOnInsertion is enabled. This should make it clear to the user that the current value will be replaced by the input (as opposed to being appended).

style.textHighlightColor is optional and nil by default, so for the existing users of ValueField nothing will change.

Demo

text-highlight-demo

@achernenko-pp achernenko-pp force-pushed the highlight-when-resetoninsertion-is-enabled branch 5 times, most recently from 980fe48 to 7824c81 Compare September 14, 2020 08:47
@achernenko-pp achernenko-pp force-pushed the highlight-when-resetoninsertion-is-enabled branch from 7824c81 to 15f94d8 Compare September 14, 2020 09:04
Copy link
Contributor

@enhorn enhorn left a comment

Choose a reason for hiding this comment

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

Seems straight forward. 💯

@achernenko-pp achernenko-pp merged commit d36721a into master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants