Skip to content

fix: call super.connectedCallback() in button sub-components - #105

Open
pramishpy wants to merge 1 commit into
github:mainfrom
pramishpy:fix-button-role-connected-callback-70
Open

fix: call super.connectedCallback() in button sub-components#105
pramishpy wants to merge 1 commit into
github:mainfrom
pramishpy:fix-button-role-connected-callback-70

Conversation

@pramishpy

Copy link
Copy Markdown

Summary

Fixes #70.

Subclasses of MarkdownButtonElement (md-header, md-bold, md-italic, md-quote, md-code, etc.) defined their own connectedCallback() without invoking super.connectedCallback(). As a result, the base class's logic to assign role="button" when no role is present was bypassed.

Changes

  • Call super.connectedCallback() in all MarkdownButtonElement subclasses in src/index.ts.
  • Add test coverage in test/test.js confirming that each markdown button custom element sets role="button" on connection if missing, and preserves any existing custom role.

Verification

  • Reproduced test failure before fix (13 test failures across all button elements).
  • Ran full Karma test suite: 143 passed, 0 failed.
  • Ran ESLint: 0 errors, 0 warnings.

@pramishpy
pramishpy requested a review from a team as a code owner September 4, 2026 22:02
Copilot AI balanced review requested due to automatic review settings September 4, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

The role code is never executed in base MarkdownButtonElement

2 participants