---
schema_version: "1"
id: 1767912b27a4c6b4d7f35ea2e2cdac2ae0c9f74a58535d9e91843c353542cb02
title: Protect Unsaved Changes in Embedded MFE Widgets (Developer Preview)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/release-notes/262-0-0/rn_mfe_dirty_state.md
canonical_url: https://help.salesforce.com/s/articleView?id=release-notes.rn_mfe_dirty_state.htm&release=262.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 9138a4c23904c468eb00780ca0f2bfbad6d45694d4c53c34046e85d560aedd0b
description: Prevent accidental data loss when users navigate away from a page with unsaved widget changes. The platform prompts users to confirm before discarding their work.
products:
  - Cross Cloud
release: "262"
---
# Protect Unsaved Changes in Embedded MFE Widgets (Developer Preview)

Prevent accidental data loss when users navigate away from a page with unsaved widget changes. The platform prompts users to confirm before discarding their work.

**Where:** This change applies to Lightning Experience in all editions.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-release-notes-salesforce_release_notes-262-0-0-production-enus/e945111b-3e0a-4011-accc-d5949363bfcc/images/icon_note.png)

Note The Dev Channel provides access to features that are not generally available and have been designated as pilot, beta, limited release, or developer preview. Their use is at the Customer's sole discretion and is subject to the Beta Services Terms at [Agreements - Salesforce.com](https://www.salesforce.com/company/legal/).

**How:** In the widget, check that the bridge is connected, then dispatch a `trackdirtystate` event via the MFE Bridge when the user modifies data:

```
if (bridge.isConnected()) {
  bridge.dispatchEvent(new CustomEvent('trackdirtystate', {
    detail: { isDirty: true, instanceId: bridge.instanceId, label: 'Product Registration' }
  }));
}
```

The event requires three fields:

- `isDirty` — `true` when the widget has unsaved changes, `false` after save or reset.
- `instanceId` — use `bridge.instanceId` to identify this widget instance.
- `label` — (optional) a descriptive name shown in the confirmation dialog (for example, "Product Registration Form"). When setting `isDirty` as true and no label is provided, the dirty-state modal displays an "unsaved changes" dialog with no label.

Navigation protection covers two scenarios:

- **In-app navigation** (clicking Salesforce tabs, links, or navigation items): The platform shows a modal listing dirty widgets by their label. Users choose to continue (discard changes) or cancel (stay on page).
- **Browser actions** (refresh, close tab, back button, address bar): The browser shows its native `beforeunload` confirmation. This dialog text can't be customized.

When multiple MFE widgets on the same page have unsaved changes, a single modal lists all dirty widgets by label.