From 410120a5896553074fc9932828a4afddb60fcce5 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Wed, 1 Jul 2026 00:36:59 -0700 Subject: [PATCH] Fix Tags table scroll staying disabled after backgrounding The POI Common Tags and All Tags tables could become permanently unscrollable. When the autocomplete completion overlay appears on iOS 26+, AutocompleteTextField disables the enclosing table view's scrolling so the overlay owns it, restoring it only when the overlay is torn down. If the app resigned active (e.g. switching to Safari) while the overlay was showing, the teardown path never ran and the Tags table was left with isScrollEnabled = false. Dismiss the completion overlay on UIApplication.willResignActive so scrolling is restored before backgrounding, and defensively re-enable the enclosing table view's scrolling when editing ends. Fixes #867 --- src/iOS/CustomViews/AutocompleteTextField.swift | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/iOS/CustomViews/AutocompleteTextField.swift b/src/iOS/CustomViews/AutocompleteTextField.swift index c176c1834..667a16724 100644 --- a/src/iOS/CustomViews/AutocompleteTextField.swift +++ b/src/iOS/CustomViews/AutocompleteTextField.swift @@ -34,6 +34,11 @@ class AutocompleteTextField: UITextField, UITextFieldDelegate, UITableViewDataSo selector: #selector(keyboardWillChange(_:)), name: UIResponder.keyboardWillChangeFrameNotification, object: nil) + NotificationCenter.default.addObserver( + self, + selector: #selector(appWillResignActive(_:)), + name: UIApplication.willResignActiveNotification, + object: nil) super.delegate = self } @@ -127,6 +132,12 @@ class AutocompleteTextField: UITextField, UITextFieldDelegate, UITableViewDataSo } } + @objc func appWillResignActive(_ nsNotification: Notification) { + guard !filteredCompletions.isEmpty else { return } + + clearFilteredCompletionsInternal() + } + func frameForCompletionTableView() -> CGRect { guard let cell = superviewOfType(UITableViewCell.self), let tableView = cell.superviewOfType(UITableView.self) @@ -274,6 +285,12 @@ class AutocompleteTextField: UITextField, UITextFieldDelegate, UITableViewDataSo func textFieldDidEndEditing(_ textField: UITextField) { clearFilteredCompletionsInternal() + if let cell = superviewOfType(UITableViewCell.self), + let tableView = cell.superviewOfType(UITableView.self) + { + tableView.isScrollEnabled = true + } + realDelegate?.textFieldDidEndEditing?(textField) }