title: How to prevent popover from scrolling when Keyboard Appears
body: <p><a href="https://i.stack.imgur.com/eq8Ec.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eq8Ec.gif" alt="Scroll Problem"></a></p>
  
  <p>I have a form (Eureka form, in a UITableView) that I show in a iPad as a Popover. But when the keyboard appears, the Tableview scrolls down and hides the field that I am editing.</p>
  
  <p>Is there a way to prevent that kind of scroll when the popover change their size? Or a way to focus again the field that I am editing?</p>
  
  <p>This is the code in the Main View Controller</p>
  
  <pre><code>func presentFormPopover(form: FormViewController) {
  
      let nav = UINavigationController(rootViewController: form)
      nav.modalPresentationStyle = .popover
      let popover = nav.popoverPresentationController!
  
      popover.sourceRect = CGRect(x: view.center.x, y: view.center.y, width: 0, height: 0)
      popover.sourceView = self.view
      popover.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
      popover.delegate = self
      popover.sourceRect = CGRect(x: self.view.bounds.midX, y: self.view.bounds.midY, width: 0, height: 0)
      self.present(nav, animated: true, completion: nil)
  }
  
  /* Reposition the popover if the screen rotates */
  
  public func popoverPresentationController(_ popoverPresentationController: UIPopoverPresentationController, willRepositionPopoverTo rect: UnsafeMutablePointer&lt;CGRect&gt;, in view: AutoreleasingUnsafeMutablePointer&lt;UIView&gt;) {
      let x = popoverPresentationController.presentingViewController.view.center
      let newRect = CGRect(x: x.x, y: x.y, width: 0, height: 0)
      rect.initialize(to: newRect)
  }
  </code></pre>
  
  <p>This is the code of the form of the Popover: </p>
  
  <pre><code>import Eureka
  
  class AddStepTaskFormViewController: FormViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
  
      self.title = "New Step Task"
  
      form +++ Section("Flowrate")
          &lt;&lt;&lt; IntRow(){
              $0.title = "Initial Flowrate"
              $0.placeholder = "Enter initial flowrate"
          }
          &lt;&lt;&lt; IntRow(){
              $0.title = "Final Flowrate"
              $0.placeholder = "Enter final flowrate"
          }
          +++ Section("Time")
  
          &lt;&lt;&lt; IntRow() {
              $0.title = "Minutes"
              $0.placeholder = "min"
          }
          &lt;&lt;&lt; IntRow() {
              $0.title = "Seconds"
              $0.placeholder = "sec"
          }
          +++ Section("Repeat")
  
          &lt;&lt;&lt; SwitchRow(){
              $0.title = "Repeat"
          }
  
          &lt;&lt;&lt; CountDownRow() {
              $0.title = "Hello"
          }
          +++ Section("Section2")
          &lt;&lt;&lt; DateRow(){
              $0.title = "Date Row"
              $0.value = Date(timeIntervalSinceReferenceDate: 0)
      }
  }
  </code></pre>