Skip to content

Commit

Permalink
[Lens][ColorMapping] Fix color mapping nitpicks (#192242)
Browse files Browse the repository at this point in the history
## Summary

Fixed the edit button color.
I've removed completely the `cursor:pointer` and the click
handler/capability over the color band (`EuiColorPaletteDisplay`
component) because this component is not a button and is not keyboard
accessible even with the click handler.
It should be changed in EUI to button to be used correctly.

fix #191878

(cherry picked from commit f3535e9)
  • Loading branch information
markov00 committed Sep 16, 2024
1 parent 949f650 commit 219c15f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { i18n } from '@kbn/i18n';
import React, { MutableRefObject } from 'react';
import { EuiButtonIcon, EuiFlexItem, EuiColorPaletteDisplay, EuiToolTip } from '@elastic/eui';
import { FIXED_PROGRESSION } from '@kbn/coloring';
import { SettingWithSiblingFlyout } from '../setting_with_sibling_flyout';

import { css } from '@emotion/react';
import { SettingWithSiblingFlyout } from '../setting_with_sibling_flyout';
export function PalettePanelContainer(props: {
palette: string[];
siblingRef: MutableRefObject<HTMLDivElement | null>;
Expand All @@ -30,6 +31,9 @@ export function PalettePanelContainer(props: {
palette={props.palette}
type={FIXED_PROGRESSION}
onClick={onClick}
css={css`
cursor: pointer;
`}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand All @@ -46,6 +50,7 @@ export function PalettePanelContainer(props: {
iconType="controlsHorizontal"
onClick={onClick}
size="xs"
color="text"
/>
</EuiToolTip>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function SettingWithSiblingFlyout({
}, [isInlineEditing, isFlyoutOpen]);

return (
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false} css={{ cursor: 'pointer' }}>
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
<SettingTrigger onClick={toggleFlyout} />
{isFlyoutOpen && siblingRef.current && (
<EuiPortal insert={{ sibling: siblingRef.current, position: 'after' }}>
Expand Down

0 comments on commit 219c15f

Please sign in to comment.