Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip beforeClose and close events sometimes not emitted #6279

Closed
nwhittaker opened this issue Jan 12, 2023 · 3 comments
Closed

Tooltip beforeClose and close events sometimes not emitted #6279

nwhittaker opened this issue Jan 12, 2023 · 3 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 8 Requires input from team, consider smaller steps. p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@nwhittaker
Copy link
Contributor

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

@nwhittaker nwhittaker added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jan 12, 2023
@github-actions github-actions bot added the ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. label Jan 12, 2023
@geospatialem
Copy link
Member

Related modal issues to beforeClose to possibly investigate together: #6407, #6381, #6379

@brittneytewks brittneytewks added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 8 Requires input from team, consider smaller steps. and removed needs triage Planning workflow - pending design/dev review. labels Apr 11, 2023
@Elijbet Elijbet self-assigned this Jun 29, 2023
@Elijbet Elijbet added 1 - assigned Issues that are assigned to a sprint and a team member. 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. 1 - assigned Issues that are assigned to a sprint and a team member. labels Jun 29, 2023
jcfranco added a commit that referenced this issue Aug 3, 2023
…s set to `display:none` (#7258)

**Related Issue:** #6279

## Summary

This PR modifies `onToggleOpenCloseComponent` to account for the cases
when `open` is toggled, event listeners are set up and the element is
removed before the transition gets a chance to start by adding a timeout
with a check of whether the transition has started.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Driscoll <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JC Franco <[email protected]>
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Aug 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 3, 2023

Installed and assigned for verification.

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Aug 3, 2023
@geospatialem
Copy link
Member

Verified in the main branch.
verify-tooltip-events

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 8 Requires input from team, consider smaller steps. p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

7 participants