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

fix(suite): HiddenPlaceholder flickering #15921

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

Lemonexe
Copy link
Contributor

@Lemonexe Lemonexe commented Dec 11, 2024

Description

Fix flickering of HiddenPlaceholder that can happen when your mouse cursor stands still exactly at element edge.
The bug does not happen on most components, only on very few such as FiatHeader. Though it is quite reliably reproducible there!

Screenshots:

Before: it actually looks much worse than the video shows because of its limited FPS 😅

bug.webm

After: with console log when onMouseMove + when onMouseLeave detects flickering and returns

flickering.stopped.webm

// prevent flickering that may happen when mouse cursor stands still exactly at the element edge
if (
approxEqual(clientX, mouseEnteredAtCoords?.clientX) &&
approxEqual(clientY, mouseEnteredAtCoords?.clientY)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empirically, event.clientX/Y are always integers (firefox, chrome), but according to mdn docs it's a double float, so let's treat it accordingly

@Lemonexe Lemonexe marked this pull request as ready for review December 11, 2024 16:32
@Lemonexe
Copy link
Contributor Author

/rebase

Copy link

@trezor-ci trezor-ci force-pushed the fix/HiddenPlaceholder-flickering branch from c84e9d5 to c59c068 Compare December 13, 2024 13:57
@Lemonexe Lemonexe merged commit b2c18de into develop Dec 13, 2024
25 checks passed
@Lemonexe Lemonexe deleted the fix/HiddenPlaceholder-flickering branch December 13, 2024 14:55
@bosomt
Copy link
Contributor

bosomt commented Jan 2, 2025

QA OK

Info:

  • Suite version: web 25.1.0 (0ad8dc0)
  • Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
  • OS: MacIntel
  • Screen: 1512x982
  • Device: Trezor T3T1 2.8.3 regular (revision 7f373ae71eca855dd41b4a0fdcc7cadaa13a8281)
  • Transport: BridgeTransport 2.0.33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants