Skip to content

fix(EuiMarkdownEditor): update types to allow UI plugins to not have a button - #9634

Merged
tkajtoch merged 2 commits into
elastic:mainfrom
tkajtoch:fix/markdown-editor-uiplugins-type
May 5, 2026
Merged

tkajtoch merged 2 commits into
elastic:mainfrom
tkajtoch:fix/markdown-editor-uiplugins-type

Conversation

@tkajtoch

@tkajtoch tkajtoch commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #9557

This PR updates the EuiMarkdownEditorUiPlugin type to make the button property optional per our documentation, and applies necessary adjustments to the internal EuiMarkdownEditorToolbar.

API Changes

component / parent prop / child change description
EuiMarkdownEditor uiPlugins[].button button is now optional The button property is now correctly marked as optional in the type definition. When unset, the button won't be rendered in the toolbar, allowing for formatting-only plugins.

Screenshots

N/A

Impact Assessment

Note: Most PRs should be tested in Kibana to help gauge their Impact before merging.

  • 🔴 Breaking changes — What will break? How many usages in Kibana/Cloud UI are impacted?
  • 💅 Visual changes — May impact style overrides; could require visual testing. Explain and estimate impact.
  • 🧪 Test impact — May break functional or snapshot tests (e.g., HTML structure, class names, default values).
  • 🔧 Hard to integrate — If changes require substantial updates to Kibana, please stage the changes and link them here.

Impact level: 🟢 None, because the type becomes less strict.

Release Readiness

  • Documentation: {link to docs page(s)}
  • Figma: {link to Figma or issue}
  • Migration guide: {steps or link, for breaking/visual changes or deprecations}
  • Adoption plan (new features): {link to issue/doc or outline who will integrate this and where}

QA instructions for reviewer

  • Type correctness
    • Checkout this PR, install dependencies and confirm that the EuiMarkdownEditorUiPlugin type allows for skipping the button property.
  • UI correctness
    • Go to https://eui.elastic.co/pr_9634/docs/components/editors-and-syntax/markdown/editor/#base-editor
    • Update the interactive example to the following:
      import React, { useCallback, useState } from 'react';
      import { EuiMarkdownEditor, getDefaultEuiMarkdownPlugins } from '@elastic/eui';
      
      const { uiPlugins } = getDefaultEuiMarkdownPlugins();
      uiPlugins.push({
       name: 'PR test',
       formatting: { prefix: '!{blah[', suffix: ']()}' },
       helpText: 'Thanks for testing my PR!'
      })
      
      export default () => {
       const [value, setValue] = useState('## Hello, World!');
       const [messages, setMessages] = useState([]);
       const onParse = useCallback((err, { messages, ast }) => {
         setMessages(err ? [err] : messages);
       }, []);
      
       const [isReadOnly, setIsReadOnly] = useState(false);
      
       const onChange = (e) => {
         setIsReadOnly(e.target.checked);
       };
      
       return (
         <EuiMarkdownEditor
           aria-label="EUI markdown editor demo"
           placeholder="Your markdown here..."
           value={value}
           onChange={setValue}
           height={400}
           onParse={onParse}
           errors={messages}
           readOnly={isReadOnly}
           initialViewMode="viewing"
           uiPlugins={uiPlugins}
         />
       );
      };
    • Confirm that the toolbar doesn't render any extra icons when compared with the default example and that TypeError: Cannot read properties of undefined (reading 'label') is not thrown (it is on main)

Checklist before marking Ready for Review

Reviewer checklist

  • Approved Impact Assessment — Acceptable to merge given the consumer impact.
  • Approved Release Readiness — Docs, Figma, and migration info are sufficient to ship.

@tkajtoch tkajtoch self-assigned this May 4, 2026
@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

cc @tkajtoch

@tkajtoch
tkajtoch marked this pull request as ready for review May 4, 2026 21:56
@tkajtoch
tkajtoch requested a review from a team as a code owner May 4, 2026 21:56
@elasticmachine

Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

cc @tkajtoch

@mgadewoll
mgadewoll self-requested a review May 5, 2026 08:49

@mgadewoll mgadewoll left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Changes are LGTM. Tested the update locally - the type for button works correctly and the button can be rendered optionally as expected.

@tkajtoch
tkajtoch merged commit 939d45e into elastic:main May 5, 2026
2 checks passed
weronikaolejniczak added a commit to elastic/kibana that referenced this pull request May 11, 2026
## Dependency updates

- `@elastic/eui` - v114.3.0 ⏩ v115.0.0
- `@elastic/eslint-plugin-eui` - v2.11.1 ⏩ v2.12.0

## Package updates

### Summary

> [!NOTE]
> Please be mindful that as the Design System team we are not aware of
your specific area pre-requisites and testing setups, and are
realistically not capable of testing the entirety of Kibana. That being
said, we want to do our best at migrating breaking changes. All tooltip
usages were updated accordingly but there might be mistakes and bugs.
That's why, **I would advise every reviewer to smoke-test their domain
tooltips**. We'd also greatly appreciate your help with adjusting
anything that may be wrong 🙏🏻


https://github.com/user-attachments/assets/2da29c89-aba1-40f9-ae3e-13790a34aedf

- tooltips **no longer appear on programmatic focus return** (e.g. when
closing flyouts, modals) - unless you're using the keyboard to navigate,
- tooltips **do not persist on mouse click** which was annoying for the
sighted users and tricky to handle in automated testing environments,
- there's **no timeout-based delay** that's inconsistent across Kibana
and makes the UI seem laggy,
- we made the **animation simpler** and tooltip content **font-size
smaller**, resulting in a better visual hierarchy,
- :accessibility: VoiceOver no longer has problems with **announcing
tooltip content** on trigger focus.

These changes have been developed with [SC 1.4.13 Content on Hover or
Focus](https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus) in mind
while providing the best possible UX.

### `@elastic/eui`
[v115.0.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Updated `EuiToolTip` default font size from 14px to 12px
([#9627](elastic/eui#9627))
- Updated `EuiToolTip` show animation to opacity-only with a 150ms grace
period delay, preventing visual flickering when quickly hovering over
multiple tooltip triggers
([#9626](elastic/eui#9626))
- Updated `EuiToolTip` to respect input modality. Tooltip no longer
persists on mouse-click focus or shows on programmatic focus return.
([#9624](elastic/eui#9624))

**Bug fixes**

- Fixed `uiPlugins[].button` type to allow UI plugins to not have a
toolbar button in `EuiMarkdownEditor`
([#9634](elastic/eui#9634))
- Fixed `EuiToolTip` self-hiding when the mouse moves over child
elements within the trigger
([#9626](elastic/eui#9626))

**Breaking changes**

- Removed `delay` prop and `ToolTipDelay` type from `EuiToolTip` and
`EuiIconTip` ([#9626](elastic/eui#9626))
- Removed `waitForEuiToolTipVisible` and `waitForEuiToolTipHidden` RTL
test helpers; tooltip show/hide is now synchronous so direct assertions
can be used instead ([#9626](elastic/eui#9626))

**Accessibility**

- Fixed invalid nested interactive elements in `EuiMarkdownEditor` by
removing `role` from the drop zone wrapper.
([#9625](elastic/eui#9625))

### `@elastic/eslint-plugin-eui`
[v2.12.0](https://github.com/elastic/eui/blob/main/packages/eslint-plugin/changelogs/CHANGELOG_2026.md)

- Added a new `prefer-tooltip-trigger-focus-test-utility` rule that
flags `fireEvent.focus()` inside `it`/`test` blocks that also query for
a tooltip. The rule auto-fixes to `focusEuiToolTipTrigger` from EUI's
RTL test utilities. ([#9624](elastic/eui#9624))

---------

Co-authored-by: kibanamachine <[email protected]>
patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request Aug 5, 2026
## Dependency updates

- `@elastic/eui` - v114.3.0 ⏩ v115.0.0
- `@elastic/eslint-plugin-eui` - v2.11.1 ⏩ v2.12.0

## Package updates

### Summary

> [!NOTE]
> Please be mindful that as the Design System team we are not aware of
your specific area pre-requisites and testing setups, and are
realistically not capable of testing the entirety of Kibana. That being
said, we want to do our best at migrating breaking changes. All tooltip
usages were updated accordingly but there might be mistakes and bugs.
That's why, **I would advise every reviewer to smoke-test their domain
tooltips**. We'd also greatly appreciate your help with adjusting
anything that may be wrong 🙏🏻


https://github.com/user-attachments/assets/2da29c89-aba1-40f9-ae3e-13790a34aedf

- tooltips **no longer appear on programmatic focus return** (e.g. when
closing flyouts, modals) - unless you're using the keyboard to navigate,
- tooltips **do not persist on mouse click** which was annoying for the
sighted users and tricky to handle in automated testing environments,
- there's **no timeout-based delay** that's inconsistent across Kibana
and makes the UI seem laggy,
- we made the **animation simpler** and tooltip content **font-size
smaller**, resulting in a better visual hierarchy,
- :accessibility: VoiceOver no longer has problems with **announcing
tooltip content** on trigger focus.

These changes have been developed with [SC 1.4.13 Content on Hover or
Focus](https://www.w3.org/TR/WCAG21/#content-on-hover-or-focus) in mind
while providing the best possible UX.

### `@elastic/eui`
[v115.0.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Updated `EuiToolTip` default font size from 14px to 12px
([elastic#9627](elastic/eui#9627))
- Updated `EuiToolTip` show animation to opacity-only with a 150ms grace
period delay, preventing visual flickering when quickly hovering over
multiple tooltip triggers
([elastic#9626](elastic/eui#9626))
- Updated `EuiToolTip` to respect input modality. Tooltip no longer
persists on mouse-click focus or shows on programmatic focus return.
([elastic#9624](elastic/eui#9624))

**Bug fixes**

- Fixed `uiPlugins[].button` type to allow UI plugins to not have a
toolbar button in `EuiMarkdownEditor`
([elastic#9634](elastic/eui#9634))
- Fixed `EuiToolTip` self-hiding when the mouse moves over child
elements within the trigger
([elastic#9626](elastic/eui#9626))

**Breaking changes**

- Removed `delay` prop and `ToolTipDelay` type from `EuiToolTip` and
`EuiIconTip` ([elastic#9626](elastic/eui#9626))
- Removed `waitForEuiToolTipVisible` and `waitForEuiToolTipHidden` RTL
test helpers; tooltip show/hide is now synchronous so direct assertions
can be used instead ([elastic#9626](elastic/eui#9626))

**Accessibility**

- Fixed invalid nested interactive elements in `EuiMarkdownEditor` by
removing `role` from the drop zone wrapper.
([elastic#9625](elastic/eui#9625))

### `@elastic/eslint-plugin-eui`
[v2.12.0](https://github.com/elastic/eui/blob/main/packages/eslint-plugin/changelogs/CHANGELOG_2026.md)

- Added a new `prefer-tooltip-trigger-focus-test-utility` rule that
flags `fireEvent.focus()` inside `it`/`test` blocks that also query for
a tooltip. The rule auto-fixes to `focusEuiToolTipTrigger` from EUI's
RTL test utilities. ([elastic#9624](elastic/eui#9624))

---------

Co-authored-by: kibanamachine <[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.

[EuiMarkdownEditorUiPlugin] Type def does not support omitting the button, even though this is supported and documented

3 participants