This commit is contained in:
Ilya Kantor 2019-07-01 14:44:23 +03:00
parent c301f7c92d
commit 2b6aec0797

View file

@ -541,6 +541,13 @@ To make something unselectable, there are three ways:
3. We can also clear the selection post-factum after it happens with `document.getSelection().empty()`. That's rarely used, as this causes unwanted blinking as the selection appears-disappears. 3. We can also clear the selection post-factum after it happens with `document.getSelection().empty()`. That's rarely used, as this causes unwanted blinking as the selection appears-disappears.
## References
- [DOM spec: Range](https://dom.spec.whatwg.org/#ranges)
- [Selection API](https://www.w3.org/TR/selection-api/#dom-globaleventhandlers-onselectstart)
- [HTML spec: APIs for the text control selections](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#textFieldSelection)
## Summary ## Summary
We covered two different APIs for selections: We covered two different APIs for selections: