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

Increase field height to fit multi line placeholder #152

Open
imthath-m opened this issue Mar 21, 2021 · 2 comments
Open

Increase field height to fit multi line placeholder #152

imthath-m opened this issue Mar 21, 2021 · 2 comments

Comments

@imthath-m
Copy link

Which version of the WSTagsField are you using?

E.g. 5.4.0

On which platform does the issue happen?

E.g. iOS 14.4

Are you using Carthage?

No

Are you using Cocoapods?

No

I installed via SPM

Which version of Xcode are you using?

Version 12.4 (12D4e)

What did you do?

Set a rather long placeholder.

tagField.placeholder = "Tags make it easier to get back in the future. You can add multiple tags separated by space"

What did you expect to happen?

TagsField to increase in height and show the full placeholder in multiple lines

What happened instead?

The placeholder was truncated at tail as shown in the image below.
image

I tried to dig in, fix it myself and send a PR. But sadly, there are a lot of things which I can't figure out. I got to enumerateItemRects function and I saw that Constants.STANDARD_ROW_HEIGHT was used in calculating the height. Other than that, I can't figure out much of what is happening there. I am not sure how to change that function and make it also work based the length of the placeholder.

Even if you can't find time to fix it, kindly point me to a reference on how to fix this, I'll do what I can and send a PR.

Thanks for the awesome component!

@ricardopereira
Copy link
Member

@imthath-m Did you tried changing the numberOfLines to 0 in the placeholder label?

@imthath-m
Copy link
Author

I can not find any placeholder label. Kindly let me know where to look.

I tried to fix this by calculating the attributed placeholder height and applying it to the text field. I've created a PR for those changes. But I'm not able to get the placeholder string to wrap across lines.

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 a pull request may close this issue.

2 participants