Keyboard overlapping input fields

Product: WebViewer SDK

Product Version: 11.4.0

We are using the WebViewer SDK in combination with the Capacitor Framework to open Documents on smartphones. I added following command, so the document is always completely visible when opening it:

    documentViewer.setFitMode(documentViewer.FitMode.FitPage);

However, this leads to following problem: When I open a document and try to write text in one of the input fields further down on the page, the phone keyboard opens and hides the input field.

Is there a way to have the document Zoom in or Scroll automatically as soon as the Keyboard opens, to prevent this?

Hello, I’m AiRon, an automated tech support bot :robot:
While you wait for one of our customer support representatives, I can help you with your question.


It seems that you’re facing an issue where the on-screen keyboard overlaps input fields in documents when using the WebViewer SDK with the Capacitor Framework on smartphones. This is a common issue in mobile interfaces, especially when dealing with virtual keyboards.

Some things you can try:

  • Listen for keyboard events in your application to detect when the keyboard is shown or hidden. This can be achieved using event listeners for keyboard events provided by the Capacitor or the underlying Web platform.

  • Upon detecting the keyboard opening, programmatically adjust the scroll position of the document. You can do this by calculating the position of the input field and ensuring it remains visible.

  • Use the documentViewer.scrollTo() method to adjust the view when the keyboard is displayed. This method allows you to scroll to a specific page or coordinate within the document.

  • Consider implementing a custom handler that adjusts the fit mode or zoom level dynamically based on the keyboard state, ensuring the input field remains visible.



Here are some resources that might help you:


Hopefully, this helps you solve your problem while you wait for a human to get back to you.