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 Blink method to textinput to return blink state #122

Merged
merged 1 commit into from Mar 1, 2022

Conversation

aschey
Copy link
Contributor

@aschey aschey commented Mar 1, 2022

As discussed on Slack earlier, this PR adds a Blink() method that returns the text input's blink state. This is useful if you want to render something more complex than the existing View() method can handle. For context, I'm implementing an input with multiple types of placeholders, each with different styles. I thought about adding something to the text input itself to handle this case, but it would add a lot of complexity for a rather niche use case. With the blink property exposed, users can implement their own View() method.

textinput/textinput.go Outdated Show resolved Hide resolved
@meowgorithm
Copy link
Member

One small comment above, otherwise we're good to go. Thanks for this one!

@aschey aschey requested a review from meowgorithm March 1, 2022 01:36
@meowgorithm meowgorithm merged commit e349920 into charmbracelet:master Mar 1, 2022
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