Skip to content

Allow text selection on checkbox labels#36970

Merged
wxiaoguang merged 5 commits into
go-gitea:mainfrom
silverwind:checkbox-label-text-selection
Mar 25, 2026
Merged

Allow text selection on checkbox labels#36970
wxiaoguang merged 5 commits into
go-gitea:mainfrom
silverwind:checkbox-label-text-selection

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Mar 24, 2026

Remove user-select: none from checkbox labels to allow text selection which is sometimes useful.

Remove user-select: none from checkbox labels and instead prevent
double-click text selection via mousedown event handler. This allows
users to select label text by click-drag while preventing accidental
selection on double-click.

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 24, 2026
Only prevent double-click (detail === 2) word selection, not
triple-click (detail === 3) line selection.

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Comment thread web_src/js/modules/fomantic/checkbox.ts Outdated
Signed-off-by: silverwind <me@silverwind.io>
@silverwind
Copy link
Copy Markdown
Member Author

If preferred, we could also just remove the JS completely here.

Comment thread web_src/js/modules/fomantic/checkbox.ts Outdated
Signed-off-by: silverwind <me@silverwind.io>
@silverwind
Copy link
Copy Markdown
Member Author

Decided to remove the JS, it's too finicky. So this is a trivial 1-line change now.

@silverwind silverwind added the type/enhancement An improvement of existing functionality label Mar 24, 2026
@silverwind silverwind requested a review from Copilot March 24, 2026 17:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to allow text selection on checkbox labels by removing the CSS rule that prevented selecting label text.

Changes:

  • Removed user-select: none from .ui.checkbox label styling to allow label text selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web_src/css/modules/checkbox.css
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 24, 2026
@wxiaoguang wxiaoguang enabled auto-merge (squash) March 25, 2026 07:39
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 25, 2026
@wxiaoguang wxiaoguang merged commit bb1e22b into go-gitea:main Mar 25, 2026
26 checks passed
@wxiaoguang wxiaoguang deleted the checkbox-label-text-selection branch March 25, 2026 07:40
@GiteaBot GiteaBot added this to the 1.26.0 milestone Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants