# EditTextToolApi.hasPendingEdits

```ts
get hasPendingEdits(): boolean
```

Whether edits are pending — not yet in the document, so not yet in [viewer.hasUnsavedChanges](https://kernstra.com/docs/web-sdk/api/pdfviewer/hasunsavedchanges). Every way of leaving the tool writes them, and so does an export from [createExporter()](https://kernstra.com/docs/web-sdk/api/pdfviewer/createexporter), so this is for a host's own `beforeunload` warning beside `hasUnsavedChanges`; `false` while the tool is not active.

- Kind: getter
- Since: 1.0.0

Returns `boolean`

```ts
window.addEventListener('beforeunload', (e) => {
  if (viewer.hasUnsavedChanges || viewer.tools.editText.hasPendingEdits) e.preventDefault();
});
```

Part of [EditTextToolApi](https://kernstra.com/docs/web-sdk/api/viewer-tools-edittext) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/viewer-tools-edittext/haspendingedits
