Blueprint: Tooltip in Popover opened itself when popover shows

Created on 3 May 2019  路  4Comments  路  Source: palantir/blueprint

Hi

mainButton has a Popover which has some buttons which has tooltip. My code below.

import { Button, Popover, Position, Tooltip, PopoverInteractionKind } from "@blueprintjs/core";

<Popover 
        position={Position.RIGHT}
        interactionKind = {PopoverInteractionKind.HOVER}
        content = {
             <div style={{padding:4}}>
                   <Tooltip content="Button 1 Tooltip" position={Position.TOP}>
                             <Button>Button1</Button>
                  </Tooltip>
                   <Tooltip content="Button 2 Tooltip" position={Position.TOP}>
                             <Button>Button2</Button>
                  </Tooltip>
                   <Tooltip content="Button 3 Tooltip" position={Position.TOP}>
                             <Button>Button3</Button>
                  </Tooltip>
         </div>

     }
>
     <Button id="mainButton">HOVER ME AND SHOW POPOVER</Button>

</Popover>

But first button's tooltip opening itself immediatelly when popover is opened. Mouse is not over on first button but why opening tooltip?

P2 core bug help wanted

Most helpful comment

Update: For some reason adding openOnTargetFocus={false} to the tooltip prevents this from happening.

All 4 comments

When hovered over main button, first button in the popover gets focused. So the tooltip is shown. I guess that should be the default behavior.

Setting autofocus={false} will fix it.

https://codesandbox.io/s/blueprintjs-popover-autofocus-ejtl5

When hovered over main button, first button in the popover gets focused. So the tooltip is shown. I guess that should be the default behavior.

Setting autofocus={false} will fix it.

https://codesandbox.io/s/blueprintjs-popover-autofocus-ejtl5

Hi,

Thanks for answer. Yes normally autofocus is solving problem. But in my case this is doesn't working.

Please check below link. I Put 2 buttons and both has popover,

One of them is CLICK_TARGET_ONLY and the other is CLICK

Please Open first popover with CLICK_TARGET and keep it's opened (you wont see any tooltip on buttons. This is good.)

And Please click Second Button and open popover.

And you will see BUTTON A's tooltip which in first popover shows immediatelly

Please check below link
https://53xm9.csb.app/

I can confirm we're also experiencing this exact issue even with autofocus=false being set

Update: For some reason adding openOnTargetFocus={false} to the tooltip prevents this from happening.

Was this page helpful?
0 / 5 - 0 ratings