WKWebView: Select Text and scroll beyond what's visible

Prime Objective

I am trying to have a scroll view with a fixed header, a fixed footer, and a WKWebView in between. Using JavaScript, the height of the webView is determined and set to be large enough to hold the entire content.

The Problem

When selecting text on the webView, the view does not scroll when the edges are reached (this works if the webView is shown without being embedded in a Scroll view, or if it is the last element)

What did I try?

I tried reading the scroll view, or adding a gesture recognizer, but all of that does not work because the selection is essentially a system task

Sourcecode

Sourcecode to demonstrate the issue can be found on GitHub

WKWebView: Select Text and scroll beyond what's visible
 
 
Q