Skip to content

Conversation

@acstll
Copy link
Contributor

@acstll acstll commented Oct 22, 2025

Summary

Resolves #8967

This adds a new outsideClickCloses prop to EuiModal. When true, the modal will close when the overlay mask (outside) is clicked.

The warning in the docs has been removed, the the Guidelines section remains intact. I did not find anything regarding outside click what needed to be updated there.

Why are we making this change?

To align with current modern UX expectations.

Impact to users

🟢 No impact. The prop defaults to false. 🟡 The type for onClose/onCancel props changed. This will cause type check fails.

onClose for EuiModalProps and onCancel for EuiConfirmModalProps:

onCancel: (
  event?:
    | React.KeyboardEvent<HTMLDivElement>
    | React.MouseEvent<HTMLButtonElement>
+   | MouseEvent
+   | TouchEvent
  ) => void;

QA

Remove or strikethrough items that do not apply to your PR.

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
    • If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@acstll acstll self-assigned this Oct 22, 2025
@acstll acstll added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Oct 22, 2025
@acstll acstll removed the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Oct 22, 2025
cy.get('[data-test-subj="modal-trigger"]').click();
cy.get('div.euiModal').should('exist');
cy.get('div.euiOverlayMask').should('exist');
cy.get('div.euiOverlayMask').click({ force: true });
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💭 since the overlay is a plain div, I believe click({ force: true }) is appropriate

@acstll acstll marked this pull request as ready for review October 22, 2025 17:50
@acstll acstll requested a review from a team as a code owner October 22, 2025 17:50
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @acstll

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @acstll

Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing my comment. The changes look great!

If there's ever need to distinguish between these two onClose triggers, we could just add a second argument with a reason or a source

@acstll acstll merged commit 5756a19 into elastic:main Oct 23, 2025
5 checks passed
mgadewoll added a commit to elastic/kibana that referenced this pull request Oct 31, 2025
- `@elastic/eui`: `v107.0.1` ⏩ `v108.0.0`
- `@elastic/eui-theme-borealis`: `v3.6.0` ⏩ `v4.0.0`

---

## Changes

>[!IMPORTANT]
This PR removes code related to the legacy Amsterdam theme. But it
purposefully keeps Amsterdam palettes in `kbn-palettes` as those are
standalone.

- removed code related to the legacy theme Amsterdam
[[#9090](elastic/eui#9090)]
- updated custom types to align with changes to the event type of
`onClose` on `EuiModal`
[[#9137](elastic/eui#9137)]

## Package updates

### [`v108.0.0`](https://github.com/elastic/eui/releases/v108.0.0)

- Updated `EuiModal` to support closing on outside click, via the new
`outsideClickCloses` prop
([#9137](elastic/eui#9137))

**Breaking changes**

- Removed all "Amsterdam" theme related code in `src/themes/amsterdam` -
EUI now only supports the "Borealis" theme in `eui-theme-borealis`
([#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasGlobalFocusColor`
([#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasVisColorAdjustment`
([#9090](elastic/eui#9090))
- Removed `hasVisColorAdjustment` argument from color palettes (used in
`euiPaletteColorBlindBehindText`, `euiPaletteForTemperature`,
`euiPaletteComplementary`, `euiPaletteCool`)
([#9090](elastic/eui#9090))
- Removed `euiTheme.flags.buttonVariant` and
`euiTheme.flags.formVariant`
([#9090](elastic/eui#9090))
- Removed `euiTheme.components.keyPadMenuItemBackgroundDisabledSelect`
([#9090](elastic/eui#9090))
- Removed legacy SCSS files from `src/global_styling/variables`,
`src/global_styling/mixins` and `src/global_styling/functions` - if
needed, use them from `eui-theme-common` instead
([#9090](elastic/eui#9090))

### [`v4.0.0`](https://github.com/elastic/eui/releases/v4.0.0)

**Breaking changes**

- Removed `euiTheme.flags.hasGlobalFocusColor`
([#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasVisColorAdjustment`
([#9090](elastic/eui#9090))
- Removed `euiTheme.flags.buttonVariant` and
`euiTheme.flags.formVariant`
([#9090](elastic/eui#9090))
- Removed `euiTheme.components.keyPadMenuItemBackgroundDisabledSelect`
([#9090](elastic/eui#9090))

---------

Co-authored-by: Elastic Machine <[email protected]>
ana-davydova pushed a commit to ana-davydova/kibana that referenced this pull request Nov 3, 2025
- `@elastic/eui`: `v107.0.1` ⏩ `v108.0.0`
- `@elastic/eui-theme-borealis`: `v3.6.0` ⏩ `v4.0.0`

---

## Changes

>[!IMPORTANT]
This PR removes code related to the legacy Amsterdam theme. But it
purposefully keeps Amsterdam palettes in `kbn-palettes` as those are
standalone.

- removed code related to the legacy theme Amsterdam
[[elastic#9090](elastic/eui#9090)]
- updated custom types to align with changes to the event type of
`onClose` on `EuiModal`
[[elastic#9137](elastic/eui#9137)]

## Package updates

### [`v108.0.0`](https://github.com/elastic/eui/releases/v108.0.0)

- Updated `EuiModal` to support closing on outside click, via the new
`outsideClickCloses` prop
([elastic#9137](elastic/eui#9137))

**Breaking changes**

- Removed all "Amsterdam" theme related code in `src/themes/amsterdam` -
EUI now only supports the "Borealis" theme in `eui-theme-borealis`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasGlobalFocusColor`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasVisColorAdjustment`
([elastic#9090](elastic/eui#9090))
- Removed `hasVisColorAdjustment` argument from color palettes (used in
`euiPaletteColorBlindBehindText`, `euiPaletteForTemperature`,
`euiPaletteComplementary`, `euiPaletteCool`)
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.buttonVariant` and
`euiTheme.flags.formVariant`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.components.keyPadMenuItemBackgroundDisabledSelect`
([elastic#9090](elastic/eui#9090))
- Removed legacy SCSS files from `src/global_styling/variables`,
`src/global_styling/mixins` and `src/global_styling/functions` - if
needed, use them from `eui-theme-common` instead
([elastic#9090](elastic/eui#9090))

### [`v4.0.0`](https://github.com/elastic/eui/releases/v4.0.0)

**Breaking changes**

- Removed `euiTheme.flags.hasGlobalFocusColor`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasVisColorAdjustment`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.buttonVariant` and
`euiTheme.flags.formVariant`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.components.keyPadMenuItemBackgroundDisabledSelect`
([elastic#9090](elastic/eui#9090))

---------

Co-authored-by: Elastic Machine <[email protected]>
albertoblaz pushed a commit to albertoblaz/kibana that referenced this pull request Nov 4, 2025
- `@elastic/eui`: `v107.0.1` ⏩ `v108.0.0`
- `@elastic/eui-theme-borealis`: `v3.6.0` ⏩ `v4.0.0`

---

## Changes

>[!IMPORTANT]
This PR removes code related to the legacy Amsterdam theme. But it
purposefully keeps Amsterdam palettes in `kbn-palettes` as those are
standalone.

- removed code related to the legacy theme Amsterdam
[[elastic#9090](elastic/eui#9090)]
- updated custom types to align with changes to the event type of
`onClose` on `EuiModal`
[[elastic#9137](elastic/eui#9137)]

## Package updates

### [`v108.0.0`](https://github.com/elastic/eui/releases/v108.0.0)

- Updated `EuiModal` to support closing on outside click, via the new
`outsideClickCloses` prop
([elastic#9137](elastic/eui#9137))

**Breaking changes**

- Removed all "Amsterdam" theme related code in `src/themes/amsterdam` -
EUI now only supports the "Borealis" theme in `eui-theme-borealis`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasGlobalFocusColor`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasVisColorAdjustment`
([elastic#9090](elastic/eui#9090))
- Removed `hasVisColorAdjustment` argument from color palettes (used in
`euiPaletteColorBlindBehindText`, `euiPaletteForTemperature`,
`euiPaletteComplementary`, `euiPaletteCool`)
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.buttonVariant` and
`euiTheme.flags.formVariant`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.components.keyPadMenuItemBackgroundDisabledSelect`
([elastic#9090](elastic/eui#9090))
- Removed legacy SCSS files from `src/global_styling/variables`,
`src/global_styling/mixins` and `src/global_styling/functions` - if
needed, use them from `eui-theme-common` instead
([elastic#9090](elastic/eui#9090))

### [`v4.0.0`](https://github.com/elastic/eui/releases/v4.0.0)

**Breaking changes**

- Removed `euiTheme.flags.hasGlobalFocusColor`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.hasVisColorAdjustment`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.flags.buttonVariant` and
`euiTheme.flags.formVariant`
([elastic#9090](elastic/eui#9090))
- Removed `euiTheme.components.keyPadMenuItemBackgroundDisabledSelect`
([elastic#9090](elastic/eui#9090))

---------

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiModal] Support click-outside behavior

3 participants