Skip to content

Commit

Permalink
fix content inset when keyboard is visible (#3207)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/392891325557410/1207990702991361/f
Tech Design URL:
CC:

**Description**:
Fix webview content inset when address bar is in bottom position.

**Steps to test this PR**:
1. Visit https://duck.ai with address bar in bottom and top position and
make sure the view adjusts accordingly.
  • Loading branch information
brindy authored Aug 9, 2024
1 parent 9809e9a commit 7db5d17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,10 @@ class MainViewController: UIViewController {

if self.appSettings.currentAddressBarPosition.isBottom {
self.viewCoordinator.constraints.navigationBarContainerHeight.constant = max(52, keyboardHeight)

// Temporary fix, see https://app.asana.com/0/392891325557410/1207990702991361/f
self.currentTab?.webView.scrollView.contentInset = .init(top: 0, left: 0, bottom: keyboardHeight > 0 ? 52 : 0, right: 0)

UIView.animate(withDuration: duration, delay: 0, options: animationCurve) {
self.viewCoordinator.navigationBarContainer.superview?.layoutIfNeeded()
}
Expand Down

0 comments on commit 7db5d17

Please sign in to comment.