Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const MarkdownEditor = ({
/>
<EuiMarkdownEditorHelpButton
uiPlugins={uiPlugins}
tooltipProps={{ position: 'bottom', delay: 'regular' }}
tooltipProps={{ position: 'bottom' }}
/>
</>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,11 @@ export const FilterBarToggleButton: React.FC<{}> = () => {
const themeContext = useEuiTheme();
const styles = toggleStyles(themeContext);

// TODO Workaround for https://github.com/elastic/eui/issues/9520
const expandTooltipRef = useRef<EuiToolTip>(null);
const buttonRef = useRef<HTMLButtonElement>(null);
const [buttonInFocusNotVisible, setButtonInFocusNotVisible] = useState(false);
const onTooltipMouseOut = useCallback(() => {
if (buttonInFocusNotVisible) {
expandTooltipRef.current?.hideToolTip();
}
}, [buttonInFocusNotVisible]);
const onButtonFocus = useCallback(() => {
if (document.querySelector('button:focus-visible') !== buttonRef.current) {
setButtonInFocusNotVisible(true);
}
}, []);
const onButtonBlur = useCallback(() => setButtonInFocusNotVisible(false), []);
// TODO End workaround, delete above block when EUI fixes this issue

return (
<EuiToolTip
ref={expandTooltipRef}
content={isCollapsed ? expandLabel : collapseLabel}
disableScreenReaderOutput
onMouseOut={
/* TODO Workaround for https://github.com/elastic/eui/issues/9520 */ onTooltipMouseOut
}
>
<EuiButtonEmpty
buttonRef={buttonRef}
Expand All @@ -77,8 +57,6 @@ export const FilterBarToggleButton: React.FC<{}> = () => {
css={styles.filterButtonStyle}
size="s"
data-test-subj="filterBarToggleButton"
onFocus={/* TODO Workaround for https://github.com/elastic/eui/issues/9520 */ onButtonFocus}
onBlur={/* TODO Workaround for https://github.com/elastic/eui/issues/9520 */ onButtonBlur}
>
<EuiFlexGroup gutterSize="xs">
<EuiFlexItem>
Expand Down
Loading