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

Multiple line placeholder #1

Closed
vikgor opened this issue Aug 10, 2020 · 4 comments
Closed

Multiple line placeholder #1

vikgor opened this issue Aug 10, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@vikgor
Copy link

vikgor commented Aug 10, 2020

I have a textView in a UITableViewCell, and the cell's height changes dynamically depending on the textView's input - when I add more lines of text or delete some of it.
However, it does not work well with the placeholder's number of lines, and only shows the 1st line of placeholder.

The cell's height changes when I add new lines
3

I am currently going around this by making my placeholder a UILabel and constantly setting up the constraints for it.

Expected
1
Reality (ignore placeholder color differences)
2

@onl1ner
Copy link
Owner

onl1ner commented Aug 10, 2020

🤔 It is because of this line placeholderTextView.frame = self.bounds. Forgot about the case when the placeholder content's height is greater than the UITextView's height. I'm gonna add some new logic, but could you please tell me what sort of behavior are you expecting when the person starts typing?

@onl1ner onl1ner added the bug Something isn't working label Aug 10, 2020
@vikgor
Copy link
Author

vikgor commented Aug 10, 2020

The moment they start typing the height is for one line of text, then the behavior is like on the 1st image (multiple lines of text) and if they clear the text, the height goes back down to what it's supposed to be (depending on the lines in placeholder) and the placeholder is shown.
It may depend on the shouldHidePlaceholderOnEditing property too, and change the height when the placeholder is shown.
Hope it makes sense

@onl1ner
Copy link
Owner

onl1ner commented Aug 11, 2020

I have pushed a new version to a master branch so could you please update the pod from there. I wish it will fix your problem.

Use this to update from master:

  • In your Podfile:
pod 'STTextView', :git => 'https://github.com/onl1ner/STTextView.git'
  • In terminal:
$ pod update

@onl1ner
Copy link
Owner

onl1ner commented Aug 16, 2020

Closing this issue due to inactivity. Please reopen if you still facing with that problem.

@onl1ner onl1ner closed this as completed Aug 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants