Skip to content

Tag input does't render with specific tags?  #151

@1dolinski

Description

@1dolinski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions