fix: stop hidden copy button blocking code text#5247
Conversation
|
Doesn't really fix the original issue. |
|
Thanks, that makes sense. I pushed 6fa626c to keep the button above the selectable code content on narrow screens instead of relying on the hidden state. The regression now checks the hover-active case too. Local checks:
|
|
hmm, yeah it works, but not really liking the extra space on top: Maybe we should position the button outside the code block (like outside that background), as a regular button in the mobile view (hover is bad from the UX perspective on mobiles anyway) Need to check how it works with code groups / titles though, especially which are longer (where a scrollbar is rendered for tabs). Don't think a padding-right can be decided for tabs without adjusting the structure. Maybe we can have better control when the title bar plugin is a part of the core. |
|
Thanks, agreed. I pushed ca9c410 to move the mobile copy button out of the code block background instead of adding top padding inside I also expanded the e2e coverage for:
Checks:
|


Description
Keeps code-block copy buttons from covering selectable code text on narrow screens by reserving a small mobile action row above the code content. The copy button still becomes usable on hover or focus, and desktop code blocks keep the existing layout.
Linked Issues
Fixes #5120
Additional Context
Checks:
pnpm -F=tests-e2e test markdown-extensions/markdown-extensions.test.tspnpm checkpnpm docs:build