[EuiModal] Support closing with outside click#9137
Merged
acstll merged 5 commits intoelastic:mainfrom Oct 23, 2025
Merged
Conversation
via new `outsideClickCloses` prop
acstll
commented
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 }); |
Contributor
Author
There was a problem hiding this comment.
💭 since the overlay is a plain div, I believe click({ force: true }) is appropriate
tkajtoch
reviewed
Oct 23, 2025
Collaborator
💚 Build SucceededHistory
cc @acstll |
Collaborator
💚 Build Succeeded
History
cc @acstll |
tkajtoch
approved these changes
Oct 23, 2025
Member
tkajtoch
left a comment
There was a problem hiding this comment.
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
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 <elasticmachine@users.noreply.github.com>
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 <elasticmachine@users.noreply.github.com>
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 <elasticmachine@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #8967
This adds a new
outsideClickClosesprop toEuiModal. Whentrue, 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
currentmodern UX expectations.Impact to users
🟢 No impact.The prop defaults tofalse. 🟡 The type foronClose/onCancelprops changed. This will cause type check fails.onCloseforEuiModalPropsandonCancelforEuiConfirmModalProps: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
Checked in both light and dark modesChecked in both MacOS and Windows high contrast modes(emulate forced colors if you do not have access to a Windows machine.)Checked in mobile@defaultif default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesUpdated visual regression testsIf applicable, added the breaking change issue label (and filled out the breaking change 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)