WSTagsField icon indicating copy to clipboard operation
WSTagsField copied to clipboard

Tag input does't render with specific tags?

Open 1dolinski opened this issue 4 years ago • 0 comments

Hi! I've come across a bug I'm having trouble solving. Maybe someone can help me figure it out.

Which version of the WSTagsField are you using?

5.4.0

On which platform does the issue happen?

iOS 14

Are you using Cocoapods?

1.10.0.rc.1

Which version of Xcode are you using?

Xcode 12.2 Build version 12B45b

What did you do?

Using WSTagsField in a form input, certain tag combinations result in an app crash / memory leak. It seems when the first one has a minus sign and there is a certain tag afterwards the input will not properly render.

func makeUIView(context: UIViewRepresentableContext<TagsInput>) -> WSTagsField {
let input = WSTagsField()
input.addTags(["zarner-bros", "hwotwx", "catrix"])
}

// Also do not work
// ["zarnerbros", "oneasdfadsfaones", "thisiscool"]
// ["warner-bros", "hbo-max", "matrix"]

This works though?

func makeUIView(context: UIViewRepresentableContext<TagsInput>) -> WSTagsField {
let input = WSTagsField()
input.addTags(["zarner-one", "iwotwx", "two"])
}
  • notice the second tag letter changed from "h" to "i"

What did you expect to happen?

I expect both tag sets to render and the app not to freeze.

What happened instead?

The app freezes and memory consumption starts to increasingly grow.

1dolinski avatar Dec 13 '20 18:12 1dolinski