Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make <summary> unselectable by default #3191

Open
xfq opened this issue Nov 3, 2017 · 5 comments
Open

Make <summary> unselectable by default #3191

xfq opened this issue Nov 3, 2017 · 5 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: rendering

Comments

@xfq
Copy link
Contributor

xfq commented Nov 3, 2017

When expanding/collapsing the <details> element, it's really easy to select the text in the <summary> element accidentally when expanding and collapsing a section quickly (just for a quick short look at the section, for example), which is annoying.

Personally, I'd like to see the selection of the <summary> element disabled by default, but I'm also glad to hear other people's comments on this suggestion.

Bugs in browsers:

@xfq
Copy link
Contributor Author

xfq commented Nov 3, 2017

There are also some discussions in w3c/i18n-drafts#123.

@annevk
Copy link
Member

annevk commented Nov 3, 2017

I don't think we use user-select (defined at https://drafts.csswg.org/css-ui-4/#content-selection) currently for anything and I'm not quite convinced we should start. Unless there's evidence this is a widespread problem this seems like a problem easily addressed by a browser extension.

@domenic
Copy link
Member

domenic commented Nov 3, 2017

I think this might be in the realm of browser UX, not spec. E.g. a browser could require dragging further than normal to start a selection from inside a summary element. The actual process of mouse down/move/up translation to selection is the problem here, not selection itself. (For example, we should not prevent keyboard selection or "Select all" or dragging to select everything in a large swathe of the page which contains a single details/summary.) And that translation process is a browser UX design issue, not a spec issue.

@zcorpan zcorpan added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: rendering labels Sep 1, 2018
@fantasai
Copy link
Contributor

@xfq In w3c/i18n-drafts#123 you noted that links don't have this problem. What's different about links vs summary that makes one a problem and the other not? And could that difference be implemented in UAs, instead of making them unselectable?

(Fwiw I agree with @domenic and @annevk that disabling selection isn't the right solution here, improving browser UX is.)

@tophf
Copy link

tophf commented Jan 14, 2021

The unwanted selection appears because of the short interval between the two clicks, which is treated by the browser as a double-click, not because the cursor moves. Indeed this looks like a bug/omission in browsers for not accounting for this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: rendering
Development

No branches or pull requests

6 participants