Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DefaultItemAction] Tooltip now is shown when DefaultItemAction is disabled #8209

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/eui/changelogs/upcoming/8134.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

## [Unreleased]

### Added
- **Wrapper Container for Disabled Items:**
- Introduced a higher-level wrapper with `cursor: not-allowed` to properly indicate the disabled status of items.
- Added the `default_item_action.styles.ts` file to house additional styles for this and potential future enhancements.

### Removed
- **Native `title` Option for Disabled Items:**
- Removed condition to show tooltip when action item is disabled.
- Removed the display of the native `title` attribute when an item is disabled.

### Fixed
- **`not-allowed` Cursor Behavior:**
- Addressed an issue where the `user-select: none` property was overriding the `not-allowed` status. The solution involved applying the cursor style to the wrapper container, ensuring the correct cursor is displayed.

### Visual Improvements
- Enhanced the disabled state representation with clear visual feedback, including the proper cursor icon and simplified styles.
Original file line number Diff line number Diff line change
Expand Up @@ -485,42 +485,50 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
<div
class="euiTableCellContent emotion-euiTableCellContent-right-wrapText-actions-desktop"
>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
<div
class=" icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
Edit
<span
class="eui-textTruncate euiButtonEmpty__text"
>
Edit
</span>
</span>
</span>
</button>
</span>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
</button>
</span>
</div>
<div
class=" icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
Delete
<span
class="eui-textTruncate euiButtonEmpty__text"
>
Delete
</span>
</span>
</span>
</button>
</span>
</button>
</span>
</div>
</div>
<span
aria-hidden="true"
Expand Down Expand Up @@ -631,42 +639,50 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
<div
class="euiTableCellContent emotion-euiTableCellContent-right-wrapText-actions-desktop"
>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
<div
class=" icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
Edit
<span
class="eui-textTruncate euiButtonEmpty__text"
>
Edit
</span>
</span>
</span>
</button>
</span>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
</button>
</span>
</div>
<div
class=" icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
Delete
<span
class="eui-textTruncate euiButtonEmpty__text"
>
Delete
</span>
</span>
</span>
</button>
</span>
</button>
</span>
</div>
</div>
<span
aria-hidden="true"
Expand Down Expand Up @@ -777,42 +793,50 @@ exports[`EuiBasicTable renders (kitchen sink) with pagination, selection, sortin
<div
class="euiTableCellContent emotion-euiTableCellContent-right-wrapText-actions-desktop"
>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
<div
class=" icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
Edit
<span
class="eui-textTruncate euiButtonEmpty__text"
>
Edit
</span>
</span>
</span>
</button>
</span>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
</button>
</span>
</div>
<div
class=" icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
Delete
<span
class="eui-textTruncate euiButtonEmpty__text"
>
Delete
</span>
</span>
</span>
</button>
</span>
</button>
</span>
</div>
</div>
<span
aria-hidden="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,59 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`DefaultItemAction renders an EuiButtonEmpty when \`type="button" 1`] = `
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
<div
class="undefined icon-wrapper css-1j3nbwz-isDisabled"
>
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
<button
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right"
type="button"
>
<span
class="eui-textTruncate euiButtonEmpty__text"
class="euiButtonEmpty__content emotion-euiButtonDisplayContent"
>
action1
<span
class="eui-textTruncate euiButtonEmpty__text"
>
action1
</span>
</span>
</span>
</button>
</span>
</button>
</span>
</div>
`;

exports[`DefaultItemAction renders an EuiButtonIcon with screen reader text when \`type="icon"\` 1`] = `
<div>
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
<div
class="undefined icon-wrapper css-1j3nbwz-isDisabled"
>
<button
aria-labelledby="generated-id"
class="euiButtonIcon emotion-euiButtonIcon-xs-empty-primary"
type="button"
<span
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock"
>
<span
aria-hidden="true"
class="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="trash"
/>
</button>
</span>
<span
class="emotion-euiScreenReaderOnly"
id="generated-id"
>
<span>
action1
<button
aria-labelledby="generated-id"
class="euiButtonIcon emotion-euiButtonIcon-xs-empty-primary"
type="button"
>
<span
aria-hidden="true"
class="euiButtonIcon__icon"
color="inherit"
data-euiicon-type="trash"
/>
</button>
</span>
</span>
<span
class="emotion-euiScreenReaderOnly"
id="generated-id"
>
<span>
action1
</span>
</span>
</div>
</div>
`;
Loading