# Atomic Range: click to select?

**URL:** <https://discuss.codemirror.net/t/atomic-range-click-to-select/9516>\
**Category:** Uncategorized\
**Created:** [September 26, 2025, 11:03am UTC](https://discuss.codemirror.net/t/atomic-range-click-to-select/9516 "2025-09-26T11:03:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alaind](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@alaind](https://discuss.codemirror.net/u/alaind)\
**Post date:** [September 26, 2025, 11:03am UTC](https://discuss.codemirror.net/t/atomic-range-click-to-select/9516/1 "2025-09-26T11:03:47Z")

</div>

We have set some tokens as atomic ranges.  
Our users have raised the issue that they cannot click to select these atomicRanges.

For example, in the official example [CodeMirror Decoration Example](https://codemirror.net/examples/decoration/) it is possible to select a word by double clicking on it, but this is not possible for an atomic range.

Is there a standard way to enable click or double click to select an atomicRange?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)\
**Post date:** [September 26, 2025, 12:39pm UTC](https://discuss.codemirror.net/t/atomic-range-click-to-select/9516/2 "2025-09-26T12:39:31Z")

</div>

You’d have to define your own mousedown handler for this, but it should be a quite easy to implement (get the position of the click, look it up in your range set, select the range if there is one, return false otherwise).

---

<div class="post-metadata">

**Author:** ![alaind](https://discuss.codemirror.net/letter_avatar_proxy/v4/letter/a/94ad74/32.png) [@alaind](https://discuss.codemirror.net/u/alaind)\
**Post date:** [September 26, 2025, 2:16pm UTC](https://discuss.codemirror.net/t/atomic-range-click-to-select/9516/3 "2025-09-26T14:16:31Z")

</div>

Not difficult indeed. Thanks for the confirmation
