Skip to content

fix(ui): wire copy button of lone code blocks - #291

Merged
JumpLink merged 1 commit into
mainfrom
work/android-copy
Nov 12, 2026
Merged

JumpLink merged 1 commit into
mainfrom
work/android-copy

Conversation

@JumpLink

Copy link
Copy Markdown
Owner

Stacks on #290.

The tutorial defers sections below the fold (deferBelowFold). A section that is only a code block IS the SourceView, and MdxView.wireSubtree walked descendants only, so the block's copy event was never forwarded. The button fired _onCopy, but nothing reached the editor.

Fix: wire the root itself when it is a SourceView.

Verified on a Galaxy S9: tap on the copy button of "Our first program" now puts the code in the Code tab.

@JumpLink
JumpLink changed the base branch from fix/android-body-size to main November 12, 2026 17:25
A deferred section that is just a code block is the SourceView itself; wireSubtree only walked descendants, so its copy event reached nobody (seen on Android, where the tutorial defers sections).
@JumpLink
JumpLink merged commit 5de0ea6 into main Nov 12, 2026
3 checks passed
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.

1 participant