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

Bugfix FXIOS-10727 [BookmarkDetails] TextField keyboard dismissed when tap on outside in AddNewBookmarks #23433

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class LegacyBookmarkDetailPanel: SiteTableViewController, BookmarksRefactorFeatu
}

updateSaveButton()
addDismissKeyboardGesture()
}

override func viewDidAppear(_ animated: Bool) {
Expand Down Expand Up @@ -333,6 +334,18 @@ class LegacyBookmarkDetailPanel: SiteTableViewController, BookmarksRefactorFeatu
return url?.schemeIsValid == true && url?.host != nil
}

private func addDismissKeyboardGesture() {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissTextFieldKeyboard))
tapGesture.cancelsTouchesInView = false
view.addGestureRecognizer(tapGesture)
}

// dismiss textField keyboard when tap on the outside view
@objc
private func dismissTextFieldKeyboard() {
view.endEditing(true)
}

// MARK: - Button Actions
func topRightButtonAction() {
save().uponQueue(.main) { _ in
Expand Down