iOS Keyboard accessory view has a gap to the rest of the keyboard on iOS 17 beta 3. Happens only on WKWebView but not on native UITextFields

I have a WebView based iOS project where the keyboard is not rendering as expected on iOS 17 but works fine on devices with iOS 15,16. Attached are the images from simulator and device.

Please help.

I tried setting WebView contentInset in keyboardWillShow() but it did not work.

This happens with

keyboardView.heightAnchor.constraint(equalToConstant: 50).isActive = true
keyboardView.leadingAnchor.constraint(equalTo: view.leadingAnchor).isActive = true
keyboardView.trailingAnchor.constraint(equalTo: view.trailingAnchor).isActive = true
keyboardView.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor).isActive = true

as well.

When you scroll to dismiss, it snaps back to the keyboard and is sticky. But until you reach the bottom, there is a gap and it doesn't follow on dismiss until hitting the bottom

iOS Keyboard accessory view has a gap to the rest of the keyboard on iOS 17 beta 3. Happens only on WKWebView but not on native UITextFields
 
 
Q