Skip to content

[EuiToolTipProps] position and delay marked as required when they aren't #9593

Closed

Description

@Zacqary

Describe the bug
EuiToolTipProps marks all props as optional except for position and delay, even though EuiToolTip itself provides defaults for these props and doesn't actually throw a typescript error if one of them is undefined:

<EuiToolTip delay="long" /> // No position, no error
<EuiToolTip position="top" /> // No delay, no error

This makes it easy to create bugs when writing components that pass a tooltipProps down to an internally rendered tooltip. My PR that added this to EuiMarkdownEditorHelpButton ended up missing this, so I had to set both position and delay to pass typecheck even though I only wanted to change the default position.

Apparently the right thing to do was work around this the way the rest of EUI does:

packages/eui/src/components/basic_table/default_item_action.tsx

  const tooltipProps: Omit<EuiToolTipProps, 'position' | 'children'> = {
    content: tooltipContent,
    delay: 'long',

packages/eui/src/components/basic_table/table_types.ts

tooltipProps?: Omit<EuiToolTipProps, 'children' | 'delay' | 'position'> & {
    delay?: EuiToolTipProps['delay'];
    position?: EuiToolTipProps['position'];
  };

packages/eui/src/components/button/button_group/button_group.tsx

toolTipProps?: Partial<Omit<EuiToolTipProps, 'content' | 'children'>>;

packages/eui/src/components/button/split_button/split_button_actions.tsx

tooltipProps?: Partial<Omit<EuiToolTipProps, 'children'>>;

If the "correct" use of this type is to convert it to a Partial or to Omit the required props, I don't think we should be requiring those props at all.

Impact and severity
Tech debt, small DX issue

Environment and versions
EUI 115

Activity

  1. added
    ⚠️ needs validation
    on Apr 15, 2026
  2. added theissue type on Apr 15, 2026
  3. removed
    ⚠️ needs validation
    on Apr 15, 2026
  4. weronikaolejniczak commented on May 6, 2026

    @weronikaolejniczak
    Contributor

    @Zacqary the issue has been addressed and the fix released on v115.0.0. The change will be added to Kibana by EOW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions