# iOS Markdown 编辑器在第二次选中文本时卡死

**URL:** <https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258>\
**Category:** Bug\
**Tags:** composer, ios\
**Created:** [2026年七月10日 11:50 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:** 1\
**Showing post:** 4

<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:** [2026年七月10日 16:27 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>

你好 @Ethsim2

我认为这与我上周为了缓解 WebKit 和 iOS（尤其是 iPad）带来的一些 UI 怪癖而所做的更改有关。

> <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.

我今天休息，周一一上班就会优先调查此事。如果你能告知你使用的设备型号，将很有帮助。

---

_[View the full topic](https://meta.discourse.org/t/ios-markdown-composer-editor-freezes-when-selecting-text-a-second-time/407258)._
