Form input fields in the business system correspond one-to-one with bookmarks in the document. When entering content in the form, the form input box loses focus, and the focus moves to the document, causing content to be entered into the document (if document protection is enabled, a prompt will appear)
Solution:
Background: Users listen to the input event of form input boxes and synchronize the input content to the corresponding bookmark area in the document in real-time by calling the bookmark.setText api.
Cause Analysis: SDK api follows the first-person perspective definition, so setter interfaces (bookmark.setText, permMark.setText, bookmark.setHtml, etc.) will automatically scroll to the specified area and automatically get focus
Solution: Use the app.setUIState api to define the default cursor behavior when other APIs are executed
// When calling api, disable focusing on the document, allow scrolling (if the api needs it)
const app = await ZOfficeSDK.mount(url, selector ,true);
await app.ready();
await app.setUIState({ cursorContext: { focus: false, scroll: true }});
[!CAUTION]
Note: setUIState api is supported starting from v8.0FP2 hotfix2