# iOS Markdown composer/editor freezes when selecting text a second time

**URL:** https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258
**Category:** Bug
**Tags:** composer, ios
**Created:** [July 10, 2026, 11:50am UTC](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258 "2026-07-10T11:50:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [July 10, 2026, 11:50am UTC](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258/1 "2026-07-10T11:50:37Z")

</div>

I am experiencing a reproducible text-selection problem in the Discourse Markdown composer on iOS.

This is separate from the `/upcoming-events` issue I reported previously. I first noticed this composer behaviour after earlier rebuilds, and it has persisted across my two most recent rebuilds.

### Versions tested

- `v2026.7.0-latest +188`
- `v2026.7.0-latest +195`

At the time of testing, `+196` was available, but the only additional commit appeared unrelated to the composer.

### Steps to reproduce

1. Open a new-topic or reply composer in Markdown mode.
2. Enter or paste several lines of text.
3. Long-press and select some text.
4. The first selection works normally.
5. Tap elsewhere to clear the selection.
6. Long-press the text again and attempt to make another selection.

### Expected result

The iOS text-selection menu and handles should appear normally each time, including the option to **Select All** where applicable.

### Actual result

Selection works when the composer is first opened.

After clearing that first selection, attempting to select text again causes the composer or text-selection interface to become unresponsive. I can no longer reliably select text, move the selection handles, or use **Select All**.

### Testing already completed

- Reproduces on `v2026.7.0-latest +188`
- Still reproduces after rebuilding to `v2026.7.0-latest +195`
- Reproduces in Discourse [safe mode](https://meta.discourse.org/t/53504?silent=true)
- Broken or obsolete theme components were removed before retesting
- The first selection consistently works; the problem begins after deselecting and trying to select again

### Environment

- Client: iOS
- Interface: installed PWA or Safari
- Composer: Markdown mode
- Discourse [safe mode](https://meta.discourse.org/t/53504?silent=true): reproduces
- Discourse version currently installed: `v2026.7.0-latest +195`

I can provide the iOS version, device model and a screen recording if useful.

---

<div class="post-metadata">

### Author: ![tannerabread](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerabread/32/526153_2.png) [@tannerabread](https://meta.discourse.org/u/tannerabread)
#### Post date: [July 10, 2026, 4:27pm UTC](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258/4 "2026-07-10T16:27:07Z")

</div>

Hi @Ethsim2

I believe this is related to a change I made last week trying to mitigate some of the UI quirks that come along with WebKit and iOS, particularly iPad.

> <https://github.com/discourse/discourse/pull/41366>
>
> There are quite a few issues with the composer positioning on iOS devices, espec…ially on iPad because that requests the desktop site and gives a desktop-looking user agent. The main issue is that the cursor drops 1-3 lines when scrolling the background behind the composer.
> 
> This utilizes the existing body-scroll-lock library to lock the scroll of the background when the composer is open on iOS devices. This fix adds extra logic to body-scroll-lock to account for 'iPad' when the user agent is requesting the desktop site. Then it wires up the lock/unlock logic to the composer position code.
> 
> This effectively locks the background while the composer is focused on iOS devices, which prevents the cursor from dropping. It also mitigates quite a few other UI quirks that occur with background scrolling.
> 
> The change to select-kit-collection.gjs was defense against a potential future issue where the select-kit collection could be the target element and would therefore throw in the check.

I’m off today and will look into this first thing on Monday. It would be helpful to know which device model you were on.

---

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [July 10, 2026, 5:08pm UTC](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258/5 "2026-07-10T17:08:34Z")

</div>

Thanks - I’m testing on an **iPhone 16 Pro (model MYNQ3QN/A)** running **iOS 26.5**.

I can reproduce it in both:

- the installed Discourse PWA
- Safari

The behaviour is the same in each case: the first text selection works, but after dismissing it, a second attempt to change length of selection causes the selection interface to become unresponsive.

I can also provide a screen recording if that would help.

---

<div class="post-metadata">

### Author: ![tannerabread](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerabread/32/526153_2.png) [@tannerabread](https://meta.discourse.org/u/tannerabread)
#### Post date: [July 14, 2026, 9:06pm UTC](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258/6 "2026-07-14T21:06:49Z")

</div>

Hey @Ethsim2 I have just merged a fix for this that will be available shortly.

> <https://github.com/discourse/discourse/pull/41711>
>
> PR #41366 introduced a regression on iOS where text-selection gestures in the co…mposer would get canceled. The scroll-lock added there routes composer touchmove events through body-scroll-lock, which calls \`preventDefault\` at scroll boundaries -- and a short textarea is always at its boundary -- so iOS never got a chance to handle the selection-handle drag.
> 
> Add a capture-phase touchmove listener on the editor that stops propagation when the editor has a selection, so the event never reaches body-scroll-lock's handlers and iOS handles the gesture natively.
> 
> \[Meta Topic\](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258)
