Skip to content

Popover with tooltip not closing #1061

@felhag

Description

@felhag

Please provide the environment you discovered this bug in.

<div class="flex flex-row">
	<hlm-popover>
		<div>
			<button hlmPopoverTrigger hlmBtn hlmTooltipTrigger="Open popover">Open popover</button>
		</div>
		<div hlmPopoverContent *brnPopoverContent>
			Content
		</div>
	</hlm-popover>
	<hlm-popover>
		<div>
			<button hlmPopoverTrigger hlmBtn hlmTooltipTrigger="Open other popover">Open other popover</button>
		</div>
		<div hlmPopoverContent *brnPopoverContent>
			Content
		</div>
	</hlm-popover>
</div>

When the first popover is open and you click the second popover button the first stays open.

Which area/package is the issue in?

popover

Description

When a popover is open and you click on a button with hlmTooltipTrigger the popover stays open. The reason for this seems this check in brn-dialog.service.ts:

cdkDialogRef.outsidePointerEvents.pipe(takeUntil(destroyed$)).subscribe(() => {
	// only close if this is the topmost overlay
	if (this._overlayCloseDispatcher._attachedOverlays.at(-1) === cdkDialogRef.overlayRef) {
		brnDialogRef.close(undefined, options?.closeDelay);
	}
});

Not sure what the right approach is for this. Maybe an exception for tooltips should be added?

Please provide the exception or error you saw


Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions