# Selection - What can we depend on?

**URL:** <https://discuss.prosemirror.net/t/selection-what-can-we-depend-on/890>\
**Category:** Uncategorized\
**Created:** [July 20, 2017, 9:32pm UTC](https://discuss.prosemirror.net/t/selection-what-can-we-depend-on/890 "2017-07-20T21:32:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanneswilm](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/johanneswilm/32/19_2.png) [@johanneswilm](https://discuss.prosemirror.net/u/johanneswilm)\
**Post date:** [July 20, 2017, 9:32pm UTC](https://discuss.prosemirror.net/t/selection-what-can-we-depend-on/890/1 "2017-07-20T21:32:27Z")

</div>

Hey, when drawing UI we depend a lot on where the selection currently is. In order to do that in the most efficient way, it would be good to know exactly what attributes one can depend on allows beign there and which ones one has to check for. For example, can we depend on `anchor` and `head` beign attributes of any selection? Or `to` and `from`?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [July 21, 2017, 10:25am UTC](https://discuss.prosemirror.net/t/selection-what-can-we-depend-on/890/2 "2017-07-21T10:25:20Z")

</div>

Everything that’s listed in the [base `Selection` class](http://prosemirror.net/docs/ref/#state.Selection) is guaranteed to exist on `state.selection`.
