vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
470 stars 83 forks source link

fix: handle tooltip controller closing state properly #8131

Closed web-padawan closed 1 week ago

web-padawan commented 1 week ago

Description

These are two findings that I discovered while working on #8129

  1. When close() is called twice e.g. on target mouseleave and then parent mouseover, the second call overwrites the __closeTimeout reference so one of the timeouts is not cleared properly on reopening and tooltip unexpectedly closes,
  2. Also, aborting close only aborts __closeTimeout but the tooltip is not removed from the closing set - so before reopening, it is immediately closed by the logic that is supposed to flush other closing tooltips.

This unfortunately can't be easily reproduced with default tooltips so I had to add a test that checks the controller logic. IMO this is fine since the controller API + manual mode is what we use in vaadin-menu-bar so we need to test it.

Type of change

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

vaadin-bot commented 5 days ago

This ticket/PR has been released with Vaadin 24.6.0.alpha4 and is also targeting the upcoming stable 24.6.0 version.