Skip to content

Commit d5c3717

Browse files
authoredMar 13, 2025
Bugfix FXIOS-11481 ⁃ Fix hangs in AutocompleteTextField setTextWithouthSearching (#25283)
* FXIOS-11481 #24969 ⁃ Fix hangs in AutocompleteTextField setTextWithouthSearching * Removed self from textDidChange Added textDidChange when clear the text
1 parent 93a99c6 commit d5c3717

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed
 

‎firefox-ios/Client/Frontend/Widgets/AutocompleteTextField.swift

+3-8
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ class AutocompleteTextField: UITextField,
4747
private var notifyTextChanged: (() -> Void)?
4848
private var lastReplacement: String?
4949

50-
override var text: String? {
51-
didSet {
52-
super.text = text
53-
self.textDidChange(self)
54-
}
55-
}
56-
5750
override var accessibilityValue: String? {
5851
get {
5952
return (self.text ?? "") + (self.autocompleteTextLabel?.text ?? "")
@@ -210,6 +203,7 @@ class AutocompleteTextField: UITextField,
210203
let text = (self.text ?? "") + (self.autocompleteTextLabel?.text ?? "")
211204
let didRemoveCompletion = removeCompletion()
212205
self.text = text
206+
textDidChange(self)
213207
hideCursor = false
214208
// Move the cursor to the end of the completion.
215209
if didRemoveCompletion {
@@ -230,6 +224,7 @@ class AutocompleteTextField: UITextField,
230224
@objc
231225
private func clear() {
232226
text = ""
227+
textDidChange(self)
233228
removeCompletion()
234229
autocompleteDelegate?.autocompleteTextField(self, didEnterText: "")
235230
}
@@ -344,7 +339,7 @@ class AutocompleteTextField: UITextField,
344339
}
345340

346341
func setTextWithoutSearching(_ text: String) {
347-
super.text = text
342+
self.text = text
348343
hideCursor = autocompleteTextLabel != nil
349344
removeCompletion()
350345
}

0 commit comments

Comments
 (0)
Failed to load comments.