Royal-Navy / design-system

Build web applications that meet the Royal Navy service standards
https://storybook.design-system.navy.digital.mod.uk
Apache License 2.0
103 stars 32 forks source link

fix(Popover): Prevent pending timer being cleared early #3717

Closed m7kvqbe1 closed 4 months ago

m7kvqbe1 commented 4 months ago

Overview

Prevent pending hideElement timer from being wrongly cleared.

Reason

Invocation of onMouseEnter handler exposed by useHideShow hook in quick succession has the potential to wrongly clear a pending timer set by hideElement. This is particularly apparent when multiple Popover instances are used adjacent to one another with small target elements. The end result would be Popovers left open when they should have closed.

Work carried out

Developer notes

This has already been tested downstream in a consuming application.

netlify[bot] commented 4 months ago

Deploy Preview for storybook-navy-digital-mod-uk ready!

Name Link
Latest commit 2feb9482aac265bfe2612a8c167a383033033ffa
Latest deploy log https://app.netlify.com/sites/storybook-navy-digital-mod-uk/deploys/65afe21ef8ee240008de2666
Deploy Preview https://deploy-preview-3717--storybook-navy-digital-mod-uk.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
75.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud