Skip to content

fix(vote): hide sticky submit bar when empty after success banner expires - #133

Open
DavidSchmidt00 wants to merge 1 commit into
stagingfrom
fix/vote-sticky-bar-ghost
Open

fix(vote): hide sticky submit bar when empty after success banner expires#133
DavidSchmidt00 wants to merge 1 commit into
stagingfrom
fix/vote-sticky-bar-ghost

Conversation

@DavidSchmidt00

Copy link
Copy Markdown
Owner

Problem

After submitting a vote, the success banner ("✓ Stimme abgegeben") auto-hides after 10 seconds (sessionSubmittedfalse). However, the .vote-submit-row container — which has position: sticky, padding, and a gradient background — remained rendered with no children, appearing as a persistent empty black strip at the bottom of the page.

Root cause

The conditional logic only controlled the content inside the div, not the div itself. When both submittedVotes !== null and sessionSubmitted === false, the inner expression evaluates to null but the wrapper <div className="vote-submit-row"> still rendered with its background and padding.

Fix

Wrap the entire <div className="vote-submit-row"> in a conditional:

{(submittedVotes === null || sessionSubmitted) && (
  <div className="vote-submit-row"></div>
)}

The bar now only renders when there is actual content: either the name input + submit button (pre-submit), or the success label (10 s window post-submit).

Test plan

  • Submit a vote → success banner appears
  • Wait 10 s → banner and the sticky bar both disappear completely
  • Navigate away during the 10 s window → bar is gone on return
  • Re-submit ("Change vote") → submit row reappears correctly

https://claude.ai/code/session_01Y9SKqkQP7DxXSe1TnXynin


Generated by Claude Code

…ner expires

The .vote-submit-row div has a sticky gradient background that remained
visible as an empty black strip after sessionSubmitted flipped back to
false (10 s after submit). Wrap the div in a conditional so it is only
rendered when there is actual content to show.

Co-Authored-By: AI Agent <noreply@agent>
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