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

Feature Request: Select All #12

Open
ergodic1 opened this issue Jul 24, 2021 · 3 comments
Open

Feature Request: Select All #12

ergodic1 opened this issue Jul 24, 2021 · 3 comments

Comments

@ergodic1
Copy link

Thanks for the great library.

Is it possible to expose selectall functionality? I can achieve this by using the following on click, but it seems like programmatic control over range selections is possible with the library.

document.execCommand("selectAll", false, undefined);

Something like Edit.select(range)?

@kitten
Copy link
Contributor

kitten commented Jul 24, 2021

I'm a little hesitant to include this. The logic exists but you have found a valid way to select all content natively without any quirks that need to be smoothed over.

In general, I'm struggling to find use-cases for selecting a specific range beyond selecting everything, which is easily possible. I think selecting a specific range may not be a common use-case. I can be convinced otherwise, but currently I'm on the fence on implementing this 😅

@ergodic1
Copy link
Author

The reason select all might want to be included is that while the above "works", it's a little buggy in terms of UX and I'm not sure we could rely on it to work in a production setting. The execcommand's success relies on the field being the currently focused field, and if there are other ui updates scheduled (popups etc, other events) then I've noticed just in dev mode it's behavior isn't reliable.

@zane
Copy link

zane commented Jun 22, 2022

I also have a need for this, and am reluctant to use document.execCommand because it's deprecated.

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

No branches or pull requests

3 participants