Let comment text be selected and copied from an open card - #84
Merged
Merged
Conversation
Obsidian turns text selection off for its whole UI and back on only for note content, so comment cards inherited user-select: none. Cards also opened on mousedown, which rebuilt the card under the pointer and focused the reply field, discarding any selection before a drag could make one. Comment text now opts back into selection, and a card opens on click instead, unless that click ended a new selection inside the card. Closes #80.
Fixes regressions from opening cards on click: - Pressing a card closes any open card above it, and the stack shifts before the button comes up, so the click landed on the column and the card never opened. The card now decides on mousedown and opens on the next mouseup anywhere. A dragstart or a new press stops the wait. - Pressing a button and sliding off it opened the card, because the click's target was the common ancestor. The exclusions are checked against the press target again. - The Empty placeholder's click handler stopped propagation, so its highlight no longer flashed. A press on it goes through the card again. - With comment text always selectable, a Reading view drag that overshot onto a card ran through the rest of the note. Text is now selectable only once a press starts in its card.
Replaces the release-based card opening from the previous two commits. Changing when a card opens caused a string of regressions: cards below an open one, buttons pressed and slid off, the Empty placeholder, and clicks with a pixel of wobble. Cards open on press again, exactly as on main. Pressing an open card doesn't rebuild it or move focus, so its text only needed to opt back into selection. Scoping that to open cards also keeps a Reading view drag through the note from running into a card: pressing in the note closes an open card before the drag starts.
kylemcd
marked this pull request as ready for review
September 22, 2026 18:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80.
Obsidian sets
user-select: noneonbodyand turns it back on only for note content, so comment cards inherited it and their text couldn't be selected anywhere. This fix is CSS only: an open card's comment text opts back in, with-webkit-user-selectfor iOS. Card behavior is unchanged frommain.An earlier version on this branch changed when cards open, from press to release. That caused several regressions, so it has been reverted.
Verified in Obsidian with real mouse input:
One new style test and one card test. The card test pins that pressing an open card doesn't rebuild its text or move focus. 287 tests pass.