Skip to content

Commit

Permalink
fix(CompositeBar): fix stucking multipleTooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunory committed Sep 29, 2023
1 parent 177cfd5 commit 3352042
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/CompositeBar/CompositeBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const CompositeBarView: FC<CompositeBarViewProps> = ({

const onMouseEnterByIndex = useCallback(
(itemIndex) => () => {
if (multipleTooltip) {
if (multipleTooltip && document.hasFocus()) {
let multipleTooltipActiveValue = multipleTooltipActive;
if (!multipleTooltipActive && itemIndex !== lastClickedItemIndex) {
multipleTooltipActiveValue = true;
Expand All @@ -139,7 +139,7 @@ const CompositeBarView: FC<CompositeBarViewProps> = ({
);

const onMouseLeave = useCallback(() => {
if (compact) {
if (compact && document.hasFocus()) {
ref.current?.activateItem(undefined as unknown as number);
if (
multipleTooltip &&
Expand Down Expand Up @@ -220,9 +220,9 @@ const CompositeBarView: FC<CompositeBarViewProps> = ({
}}
/>
</div>
{type === 'menu' && (
{type === 'menu' && multipleTooltip && (
<MultipleTooltip
open={compact && multipleTooltip && multipleTooltipActive}
open={compact && multipleTooltipActive}
anchorRef={tooltipRef}
placement={['right-start']}
items={items}
Expand Down

0 comments on commit 3352042

Please sign in to comment.