Skip to content

fix #193: prevent scrollbar glitch on hold action ripple animation - #198

Merged
iantrich merged 1 commit into
betafrom
iantrich/fix-193
Jun 17, 2026
Merged

fix #193: prevent scrollbar glitch on hold action ripple animation#198
iantrich merged 1 commit into
betafrom
iantrich/fix-193

Conversation

@iantrich

@iantrich iantrich commented Jun 9, 2026

Copy link
Copy Markdown
Owner

The Problem:
When a user holds down on the card, a circular ripple animation (<div class="action-handler-restriction-card">) is created and temporarily attached to the document body to visually indicate the interaction.
In src/action-handler-directive.ts, this element was styled with position: absolute; and its position was set using clientX and clientY (which are coordinates relative to the viewport).
Because position: absolute; positions the element relative to the document body, placing the ripple near the bottom or right edge of the screen could temporarily push the document's boundaries outward as it animated with scale(1). This mismatch between viewport coordinates and document positioning caused the browser to suddenly render scrollbars and shift the view until the animation completed and the element was hidden.

The Solution:
I changed the positioning of the ripple element from position: absolute to position: fixed.

  const div = document.createElement('div');
  div.className = 'action-handler-restriction-card';
- div.style.position = 'absolute';
+ div.style.position = 'fixed';

Since position: fixed works exactly with viewport coordinates (clientX/clientY) and is bound by the viewport edge, the ripple animation now correctly appears exactly where the user taps and will no longer artificially expand the document to cause random scrollbars.

  • Gemini 3.1 Pro

@iantrich
iantrich requested a review from ildar170975 June 9, 2026 04:03
@iantrich iantrich self-assigned this Jun 9, 2026
@iantrich
iantrich changed the base branch from master to beta June 9, 2026 04:03
@ildar170975

Copy link
Copy Markdown
Collaborator

Tested, seems to be OK!

@iantrich
iantrich merged commit c247df1 into beta Jun 17, 2026
3 checks passed
@iantrich
iantrich deleted the iantrich/fix-193 branch June 17, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants