Skip to content

Tooltip beforeClose and close events sometimes not emitted #6279

@nwhittaker

Description

@nwhittaker

Actual Behavior

If a tooltip is open inside a container when a display: none style is set on the container, the tooltip never emits calciteTooltipBeforeClose and calciteTooltipClose events.

Expected Behavior

If a tooltip is open inside a container when a display: none style is set on the container, the tooltip still emits calciteTooltipBeforeClose and calciteTooltipClose events.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/bGjRNEW

Reproduction Steps

  1. Visit the sample and open the console.
  2. Mouse into the red-bordered box and see the "Hover for Tooltip" text appear.
  3. Mouse onto the "Hover for Tooltip" text and wait for the tooltip to open.
  4. Quickly mouse out of the red-bordered box and wait a few seconds. Notice that none of the tooltip's close events are logged to the console.

Reproduction Version

next.721

Relevant Info

IIRC, transitionstart and transitionend events don't fire if the element doesn't have display which may explain why the tooltip isn't emitting its close events.

Regression?

No response

Impact

For performance reasons, the Field Maps web-app has some logic that remove a tooltip after it closes. In some cases, those tooltips appear alongside buttons that gain/lose display depending on whether a containing element is being hovered.

The current solution is to wait a hard-coded amount of time before removing the tooltip, but waiting for the event would be cleaner and easier to maintain.

Esri team

ArcGIS Field Apps

Metadata

Metadata

Assignees

Labels

4 - verifiedIssues that have been tested, confirmed as mitigated, and are ready to close.ArcGIS Field AppsIssues logged by ArcGIS Field Apps team members.bugBug reports for broken functionality. Issues should include a reproduction of the bug.estimate - 8Requires input from team, consider smaller steps.p - mediumIssue is non core or affecting less that 60% of people using the library

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions