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

How to add delete button next to the already added tag? #166

Open
kuldeep13990 opened this issue Feb 3, 2023 · 2 comments
Open

How to add delete button next to the already added tag? #166

kuldeep13990 opened this issue Feb 3, 2023 · 2 comments

Comments

@kuldeep13990
Copy link

How can I add a delete button next to the tag? And pressing that button the particular tag should be deleted?

@mabeljarsdel
Copy link

you need to modify the code, use this:

        textField.onDeleteBackwards = { [weak self] in
            if self?.readOnly ?? true {
                return
            }

            /*
             // Original
            if self?.isTextFieldEmpty ?? true, let tagView = self?.tagViews.last {
                self?.selectTagView(tagView, animated: true)
                self?.textField.resignFirstResponder()
            }
             */
            
            if let tagView = self?.tagViews.last {
                self?.removeTag(tagView.displayText)
            }

@mabeljarsdel
Copy link

I know, maybe is too late for you, (I'm not the author), just played with this repo a little.

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

No branches or pull requests

2 participants