# Android + Decoration.inline + GBoard: Selection handles disappear during highlighting

**URL:** <https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463>\
**Category:** Uncategorized\
**Created:** [June 24, 2025, 11:24am UTC](https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463 "2025-06-24T11:24:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Playa](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/playa/32/4435_2.png) [@Playa](https://discuss.prosemirror.net/u/Playa)\
**Post date:** [June 24, 2025, 11:24am UTC](https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463/1 "2025-06-24T11:24:30Z")

</div>

Hi everyone!

We’ve run into an issue using `Decoration.inline` on Android in combination with GBoard.

The problem occurs when we try to highlight the user’s text selection by applying `Decoration.inline` to the selected range. This works perfectly on iOS and desktop browsers. However, on Android, as soon as you start selecting text, the selection handles disappear or get reset while dragging.

We suspect this happens because updating the DOM during an active selection (with `Decoration.inline`) causes the browser to lose track of the selection state.

Has anyone else encountered this behavior and found a workaround or a stable solution for Android?

We’d be really grateful for any shared experience or advice — thanks!

Here’s the code where we apply `Decoration.inline`, as well as a [visual demonstration of the issue](https://youtube.com/shorts/oK_DclHFsoM?feature=share):

```auto
decorations(state: EditorState): DecorationSet | null {
	if (state.selection.empty || 'node' in state.selection) return null;

	return DecorationSet.create(state.doc, [
		Decoration.inline(state.selection.from, state.selection.to, {
			class: constants.class,
			nodeName: 'span',
		}),
	]);
}

```

---

<div class="post-metadata">

**Author:** ![zlunar616](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/zlunar616/32/3672_2.png) [@zlunar616](https://discuss.prosemirror.net/u/zlunar616)\
**Post date:** [June 30, 2025, 7:46am UTC](https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463/2 "2025-06-30T07:46:21Z")

</div>

Does anyone have any thoughts?

---

<div class="post-metadata">

**Author:** ![Playa](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/playa/32/4435_2.png) [@Playa](https://discuss.prosemirror.net/u/Playa)\
**Post date:** [July 9, 2025, 6:26am UTC](https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463/3 "2025-07-09T06:26:42Z")

</div>

up? ☹

---

<div class="post-metadata">

**Author:** ![Playa](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/playa/32/4435_2.png) [@Playa](https://discuss.prosemirror.net/u/Playa)\
**Post date:** [October 27, 2025, 6:59am UTC](https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463/4 "2025-10-27T06:59:48Z")

</div>

@marijn Hi! Do u have any ideas?

---

<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:** [October 27, 2025, 7:24am UTC](https://discuss.prosemirror.net/t/android-decoration-inline-gboard-selection-handles-disappear-during-highlighting/8463/5 "2025-10-27T07:24:16Z")

</div>

Not really. You could try delaying your decoration changes during touch selection.
