Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitesmith/WSTagsField
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: df036dfa8c68048266e896a7386cf052b13f5869
Choose a base ref
..
head repository: whitesmith/WSTagsField
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 72a33ef712359cb29b7cfe2e2630ff9e35aa2d99
Choose a head ref
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/WSTagsField.swift
4 changes: 2 additions & 2 deletions Source/WSTagsField.swift
Original file line number Diff line number Diff line change
@@ -635,12 +635,12 @@ extension WSTagsField {
textField.onDeleteBackwards = { [weak self] in
if self?.readOnly == true { return }

if self?.allowsMultipleSelection == true, let lastTag = self?.tags.last {
if self?.allowsMultipleSelection == true, self?.textField.text?.isEmpty == true, let lastTag = self?.tags.last {
self?.removeTag(lastTag)
return
}

if self?.textField.text?.isEmpty ?? true, let tagView = self?.tagViews.last {
if self?.textField.text?.isEmpty == true, let tagView = self?.tagViews.last {
self?.toggleTagView(tagView, animated: true)
self?.textField.resignFirstResponder()
}