Title: IsolatedEventContainer
Published: March 9, 2021
Last modified: October 14, 2026

---

# IsolatedEventContainer

## In this article

 * [Usage](https://developer.wordpress.org/block-editor/reference-guides/components/isolated-event-container/?output_format=md#usage)
 * [Props](https://developer.wordpress.org/block-editor/reference-guides/components/isolated-event-container/?output_format=md#props)

**Deprecated**

This is a container that prevents certain events from propagating outside of the
container. This is used to wrap
 UI elements such as modals and popovers where the
propagated event can cause problems. The event continues to work inside the component.

For example, a `mousedown` event in a modal container can propagate to the surrounding
DOM, causing UI outside of the
 modal to be interacted with.

The current isolated events are:

 * mousedown – This prevents UI interaction with other `mousedown` event handlers,
   such as selection

## 󠀁[Usage](https://developer.wordpress.org/block-editor/reference-guides/components/isolated-event-container/?output_format=md#usage)󠁿

Creates a custom component that won’t propagate `mousedown` events outside of the
component.

    ```language-jsx
    import { IsolatedEventContainer } from '@wordpress/components';

    const MyModal = () => {
        return (
            <IsolatedEventContainer
                className="component-some_component"
                onClick={ clickHandler }
            >
                <p>This is an isolated component</p>
            </IsolatedEventContainer>
        );
    };
    ```

## 󠀁[Props](https://developer.wordpress.org/block-editor/reference-guides/components/isolated-event-container/?output_format=md#props)󠁿

All props are passed as-is to the `<IsolatedEventContainer />`

First published

March 9, 2021

Last updated

October 14, 2026

Edit article

[ Improve it on GitHub: IsolatedEventContainer ](https://github.com/WordPress/gutenberg/edit/trunk/packages/components/src/isolated-event-container/README.md)

[  Previous: InputControl](https://developer.wordpress.org/block-editor/reference-guides/components/input-control/)

[  Next: ItemGroup](https://developer.wordpress.org/block-editor/reference-guides/components/item-group/)