AutocompleteViewController: adjust insets on keyboard appearance

This commit is contained in:
James Magahern
2022-02-18 19:12:50 -08:00
parent b9157af2b2
commit a374d0d102
3 changed files with 5 additions and 27 deletions

View File

@@ -29,7 +29,7 @@ class BrowserView: UIView
didSet { setNeedsLayout() }
}
var autocompleteView: UIView? {
var autocompleteView: UICollectionView? {
didSet {
addSubview(autocompleteView!)
if let toolbarView = toolbarView {
@@ -170,6 +170,8 @@ class BrowserView: UIView
if let autocompleteView = autocompleteView {
// Compact: autocomplete view takes the space of the webview
autocompleteView.frame = bounds.inset(by: webViewContentInset)
autocompleteView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: keyboardLayoutOffset, right: 0)
autocompleteView.scrollIndicatorInsets = autocompleteView.contentInset
if traitCollection.horizontalSizeClass == .regular {
// Regular: shows up just underneath the url bar