Skip to content

TINYDOC-3566 - Fix textarea id selector in suggestededits-access-read live demo - #4297

Merged
kemister85 merged 1 commit into
tinymce/8from
hotfix/8/TINYDOC-3566
Jul 29, 2026
Merged

TINYDOC-3566 - Fix textarea id selector in suggestededits-access-read live demo#4297
kemister85 merged 1 commit into
tinymce/8from
hotfix/8/TINYDOC-3566

Conversation

@kemister85

@kemister85 kemister85 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Ticket: TINYDOC-3566

Site: Staging branch

Changes:

  • modules/ROOT/examples/live-demos/suggestededits-access-read/index.js — corrected the querySelector call on line 3 to target textarea#suggestededits-access-read instead of textarea#suggestededits-access-feedback. The mismatched id belongs to the sibling suggestededits-access-feedback demo, so this was a copy-paste leftover. The tinymce.init selector on line 7 was already correct; only the element lookup was wrong.

What was broken

The "Edit on CodePen" export for that demo. The CodePen payload is self-contained: only the demo's own HTML and JS are sent. The sibling textarea is absent there, so tinymceElement is null and the getAttribute('suggestededits-model') call on line 4 throws a TypeError, leaving the pen uninitialised.

The demo on the docs page was not broken. The live-demo widget renders every demo into one shared document — there is no per-demo iframe — and both demos are emitted by the same partial, modules/ROOT/partials/configuration/suggestededits_access.adoc. The wrong selector therefore still resolved, to the sibling demo's textarea on the same page. Both demos' suggestededits-model attributes are byte-for-byte identical, so the read demo received correct model data regardless.

That on-page behaviour held only by coincidence: it depended on the sibling demo staying co-located and the two models staying identical.

What the fix does

  • Repairs the CodePen export, which now resolves its own textarea and initialises.
  • Makes the demo self-contained, so it no longer depends on a sibling demo being present on the same page or on the two models remaining identical.
  • Leaves on-page rendering unchanged, since it already worked.

Verification

  • Local Antora build (npx antora ./antora-playbook-local.yml) completes with no errors or warnings.
  • In the built page, all four Suggested Edits demos now have matching querySelector and tinymce.init selectors — 11 paired occurrences, all matching.
  • Decoded the CodePen payload for this demo out of the built page: it contains its own textarea#suggestededits-access-read and not the sibling's, confirming the pen depended on an element it never ships. Payload composition was verified from the build; a pen was not opened and run.
  • The two demo models were compared as parsed JSON and are identical, which is what confirms there is no on-page behaviour change.
  • The sibling suggestededits-access-feedback demo is untouched.

Pre-checks:

  • Branch is correctly prefixed: hotfix/8/TINYDOC-3566
  • Build passes without console errors, warnings, or issues.

Review:

  • Documentation Team Lead has reviewed.

@kemister85
kemister85 marked this pull request as ready for review July 29, 2026 00:42
@kemister85
kemister85 requested review from a team and soritaheng as code owners July 29, 2026 00:42
@kemister85
kemister85 merged commit 350849c into tinymce/8 Jul 29, 2026
5 checks passed
@kemister85
kemister85 deleted the hotfix/8/TINYDOC-3566 branch July 29, 2026 04:20
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.

3 participants