WSTagsField icon indicating copy to clipboard operation
WSTagsField copied to clipboard

Increase field height to fit multi line placeholder

Open imthath-m opened this issue 3 years ago • 2 comments

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!

imthath-m avatar Mar 21 '21 05:03 imthath-m

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

ricardopereira avatar Mar 26 '21 12:03 ricardopereira

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.

imthath-m avatar Mar 27 '21 06:03 imthath-m