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

fix(textinput): Placeholder No Longer Changes Width + Paste Calculation #451

Merged
merged 13 commits into from Dec 23, 2023

Conversation

hopefulTex
Copy link
Contributor

Previously, the placeholderView() function did not respect Width when it was set to a non-zero value. The textinput's width now stays the same irrelevant of the placeholder length.
Pasting now trims to match the available space if length is greater than the charLimit.

@maaslalani
Copy link
Member

Thank you so much @hopefulTex, just tested this out with various values for placeholder and width and it works great! Really appreciate the PR ❤️

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

Pasting now trims to match the available space if length is greater than the charLimit.

Great catch on this as well!

@maaslalani maaslalani merged commit f36aa3c into charmbracelet:master Dec 23, 2023
9 checks passed
maaslalani added a commit to prgres/bubbles that referenced this pull request Feb 28, 2024
…on (charmbracelet#451)

* Fix pasting calculations

Available length calculation now correctly trims pasted text.

* fix(textInput): Width padding added when placeholder is used

When `placeholder` is set, padding from `Width` was not added within the `placeholderView()` function.

* Adding missing 'm.'

* Maintain Width no matter placeholder size delta

* Fixed Math

* Added Comments

* fix: lint

---------

Co-authored-by: Donovan Hubbard <37090676+donovanhubbard@users.noreply.github.com>
Co-authored-by: Maas Lalani <maas@lalani.dev>
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

3 participants