Skip to content

#1833 - Toolbar buttons are stuck to the main comment form#1948

Merged
umputun merged 2 commits intoumputun:masterfrom
ur300:master
Dec 4, 2025
Merged

#1833 - Toolbar buttons are stuck to the main comment form#1948
umputun merged 2 commits intoumputun:masterfrom
ur300:master

Conversation

@ur300
Copy link
Copy Markdown
Contributor

@ur300 ur300 commented Sep 7, 2025

Fixes #1833
I reworked CommentForm a little bit so it creates a unique textareaId in constructor instead of render function

@ur300 ur300 requested a review from umputun as a code owner September 7, 2025 14:04
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.19%. Comparing base (d925584) to head (98443e4).
⚠️ Report is 50 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1948   +/-   ##
=======================================
  Coverage   62.19%   62.19%           
=======================================
  Files         132      132           
  Lines        3026     3026           
  Branches      764      721   -43     
=======================================
  Hits         1882     1882           
  Misses       1140     1140           
  Partials        4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@umputun umputun requested review from Mavrin, akellbl4 and paskal October 1, 2025 07:02
akellbl4
akellbl4 previously approved these changes Oct 1, 2025
@umputun umputun requested a review from Copilot October 1, 2025 15:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where toolbar buttons were stuck to the main comment form by implementing proper textarea ID management. The core issue was that textarea IDs were being generated in the render function, causing instability.

  • Moved textarea ID generation from render function to constructor for consistency
  • Changed static property name from textareaId to textareaCounter for clarity
  • Added instance property textareaId to store the unique ID per component

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
comment-form.tsx Refactored textarea ID generation to occur in constructor instead of render function
comment-form.spec.tsx Updated test cleanup to reset the renamed counter property

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

static textareaId = 0;
static textareaCounter = 0;
/** unique textarea ID for this instance */
textareaId: string;
Copy link

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The textareaId property should be initialized in the declaration or marked as definitely assigned. Consider either initializing it as textareaId!: string; or textareaId = ''; to indicate it will be assigned in the constructor.

Suggested change
textareaId: string;
textareaId!: string;

Copilot uses AI. Check for mistakes.
Improve code quality based on review feedback: mark textareaId as
readonly since it should never change after construction, and add
JSDoc to static textareaCounter explaining its purpose.
@umputun umputun merged commit 4a2bb5e into umputun:master Dec 4, 2025
9 checks passed
@paskal paskal added this to the v1.15.0 milestone Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toolbar buttons are stuck to the main comment form

5 participants