# 模态输入字段导致主题页面跳转到顶部

**URL:** <https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187>\
**Category:** Bug\
**Tags:** mobile, ios\
**Created:** [2025年八月25日 13:25 UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187 "2025-08-25T13:25:11Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Don](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/don/32/228726_2.png) [@Don](https://meta.discourse.org/u/Don)\
**Post date:** [2025年九月5日 09:47 UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/7 "2025-09-05T09:47:05Z")

</div>

你好 👋

我认为我已经找到了导致此问题的原因。

> <https://github.com/discourse/discourse/blob/6c8c1bb7b616d8861ce0d3a2321c1223778dac40/app/assets/javascripts/discourse/app/components/d-modal.gjs#L248-L253>

我通过一个简单的自定义主题组件禁用了这里的滚动到顶部功能进行测试，现在似乎运行正常，但我不太确定这段代码的原因，所以禁用或删除它可能不是最佳解决方案。

演示：[Theme Creator](https://discourse.theme-creator.io/theme/Don/d-modal-fix)

---

_[View the full topic](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187)._
