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

Define behavior for user action of "selecting all". #105

Open
mbrodesser opened this issue May 16, 2019 · 6 comments
Open

Define behavior for user action of "selecting all". #105

mbrodesser opened this issue May 16, 2019 · 6 comments

Comments

@mbrodesser
Copy link

It's currently unspecified, how user agents should use the selection API when selecting all elements on a page, for instance via pressing CTRL+a.

This is required to align and preserve the behavior across browsers.

@johan
Copy link

johan commented May 16, 2019

The Select All action also lacks an event to subscribe to, necessitating web developers to bind arbitrary localized keyboard shortcuts like ctrl/cmd-a if they want to do a sane contextual action in response to it — which still won’t happen if you pick Edit → Select All from the window or context menu.

@rniwa rniwa added the NewAPI label May 21, 2019
@rniwa
Copy link
Contributor

rniwa commented Jun 5, 2019

Knowing the contextual information about selection change is #56.

I'm not certain what you mean by specifying the behavior when selecting all text in a page. What the browser may do in response to mouse / keyboard input is in fact implementation dependent because platform conventions would differ.

@rniwa rniwa added Compatibility and removed NewAPI labels Jun 5, 2019
@mbrodesser
Copy link
Author

Having reconsidered the issue, I agree. It seems reasonable to assume that browsers call selectAllChildren when a user triggers the "Select All" mechanism (one way or the other). Closing this issue.

@mbrodesser
Copy link
Author

Outside of this ticket, @annevk brought up the following idea:

the underlying concept of "Select All" could be described in a separate section. selectAllChildren of the API would invoke it. Moreover, a "User actions" section would describe various means (on-screen keyboard, hardware keyboard, context-menu, perhaps others) in a platform-independent manner, which invoke that concept too.
The separation of concept and API would have the additional advantage that other specifications could refer to the concept, instead of the API, which can be overridden.

@mbrodesser mbrodesser reopened this Jun 7, 2019
@mbrodesser mbrodesser changed the title Define behavior for user action of selecting all text Define behavior for user action of "selecting all". Jun 7, 2019
@rniwa
Copy link
Contributor

rniwa commented Jun 8, 2019

Sure, I think defining what selectAllChildren does make sense.

@johan
Copy link

johan commented Jun 11, 2019

the underlying concept of "Select All" could be described in a separate section.

Defining the Selection api's selectAllChildren() semantics seems useful,

selectAllChildren of the API would invoke it. Moreover, a "User actions" section would describe various means (on-screen keyboard, hardware keyboard, context-menu, perhaps others) in a platform-independent manner, which invoke that concept too.

...but not tightly mapped to what a user invoking their browser's "Select All" action should do (except perhaps as a default action in a normal DOM page editing context).

If the visited web app is some kind of productivity app or game, that seems to fall under #56. DOM tree operations like selectAllChildren would not be the wanted immediate effect, rather something the app can capture to translate it to arbitrary actions like "select all emails", "select all the tavern's inventory", or whatever its current context is about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants