Skip to content

Respect textarea editability before applying formatting - #116

Open
feritcemkahraman wants to merge 1 commit into
github:mainfrom
feritcemkahraman:fix/respect-textarea-editability
Open

feritcemkahraman wants to merge 1 commit into
github:mainfrom
feritcemkahraman:fix/respect-textarea-editability

Conversation

@feritcemkahraman

Copy link
Copy Markdown

Formatting buttons can change a readonly or disabled textarea, including one disabled by its surrounding fieldset. This also emits an input event even though the field is not editable.

Check the field's readonly and native disabled states before applying formatting. The regressions verify that restricted fields keep their value and emit no input event, then format normally again when enabled.

Validation: all three regressions failed before the fix; all 147 Chromium tests now pass through the repository's Karma runner. The TypeScript distribution/declaration build and full configured ESLint check pass using the installed lockfile dependencies on Node 24. The Windows cleanup wrapper was bypassed by running the same tools directly; Firefox and WebKit were not run.

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.

🟢 Approval recommended

The focused guard and regression tests cover the intended restrictions and recovery behavior without unresolved issues.

No open issues 🎉

What changed in this PR

Prevents toolbar formatting from modifying textareas that are not editable.

Changes:

  • Guard formatting for readonly, disabled, and fieldset-disabled textareas.
  • Add regressions verifying unchanged values, no input events, and normal formatting after re-enabling.
File Description
test/​test.js Tests all three restrictions and recovery.
src/​index.ts Checks editability before applying formatting.

Review effort: Max

This branch has not been deployed

No deployments
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