Comments (3)
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
from use-editable.
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.
from use-editable.
I also have a need for this, and am reluctant to use document.execCommand
because it's deprecated.
from use-editable.
Related Issues (20)
- Contribution HOT 3
- Feature Suggestion: Disable line break HOT 2
- Deleting character in empty field throws error HOT 1
- Setting contentEditable without setAttribute does not set the attribute in js-dom HOT 4
- Bug: Caret not positioning correctly when not clicking directly on the text HOT 10
- [Feature Request] Provide (x, y) coordinates HOT 1
- UseEditable keeps `state.position` after blur, and steals focus on rerender HOT 4
- Example code seems to be broken HOT 1
- delete long content (childrenElementCount =800) is very slow (takes ~ 6 sec) HOT 1
- Dropdown-example HOT 2
- Uncaught DOMException: Failed to execute 'getRangeAt' on 'Selection': 0 is not a valid index.
- Support meta data over data attributes
- First selection + delete/backspace press does not work HOT 2
- Edit.insert does not trigger onChange
- Element loses focus on first state change in React 18 HOT 5
- No parent error. HOT 2
- SSR is not working due to MutationObserver HOT 5
- onSelect event is not firing in Chrome & Safari HOT 2
- /n line added to contentEditable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-editable.