# Modal input fields cause page jump to top of the page

**URL:** https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187
**Category:** Bug
**Tags:** mobile, ios
**Created:** [August 25, 2025, 1:25pm 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:** 14
**Page:** 1

<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: [August 25, 2025, 1:25pm UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/1 "2025-08-25T13:25:11Z")

</div>

Hello 👋

This is a long-standing issue that occurs in the topic when you try to type something into a modal input field. It always jumps to the top of the page, which results in an infinite load until it reaches post 1. It’s still an issue with the Glimmer Post Stream.

It makes very difficult to move posts to another topic because the modal also jumps while loading, other write related process and it also causes problems with the new discourse reaction feature, which opens the emoji picker. When it opens, it automatically focuses on the emoji search input, which produces the same behavior. It jumps to the top of the page and closes the emoji picker… So it happens when the modal input field focused.

This issue seems only happens on iOS.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 26, 2025, 4:13am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/2 "2025-08-26T04:13:02Z")

</div>

Weird issue, my guess is that we are bubbling events where we should not.

Maybe @saquetim has some ideas here?

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [August 27, 2025, 10:18pm UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/5 "2025-08-27T22:18:12Z")

</div>

What version of iOS do you have @don please? I have seen this issue few times, but Im not able to repro lately.

---

<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: [August 28, 2025, 4:14am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/6 "2025-08-28T04:14:14Z")

</div>

I’m on iOS 18.6.1 now but I experienced it on the older ones too.

---

<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: [September 5, 2025, 9:47am 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>

Hello 👋

I think I’ve found what causes this issue.

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

I’ve disabled the scroll to top here with a simple theme component for testing and it seems works fine now but I’m not sure what’s the reason for this code, so disabling or removing it is probably not the best solution.

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

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [September 5, 2025, 1:26pm UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/8 "2025-09-05T13:26:20Z")

</div>

I wonder if it was not to prevent a bug in iOS which has now been fixed?

---

<div class="post-metadata">

### Author: ![gingerbeardman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gingerbeardman/32/540824_2.png) [@gingerbeardman](https://meta.discourse.org/u/gingerbeardman)
#### Post date: [September 10, 2025, 9:59am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/9 "2025-09-10T09:59:29Z")

</div>

That code was only added Oct 2024.

So at least it’s not the cause of the reason I’m following this thread, as [my bug](https://meta.discourse.org/t/editing-a-post-takes-me-back-many-posts-redux/180212/) was first reported in 2020.

[https://github.com/discourse/discourse/commit/0983e73c2cdc557938340f5a5efe8aa101c388a6](https://github.com/discourse/discourse/commit/0983e73c2cdc557938340f5a5efe8aa101c388a6)

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [September 28, 2025, 10:47am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/10 "2025-09-28T10:47:26Z")

</div>

I still get this bug, in fact things jump all over the place in mobile Safari, I find it a really bad user experience on mobile.

I also get an annoying bug when scrolling up in a topic to read older posts, as they load it jumps around and I end up skipping over posts.

I do hope it can be fixed.

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [September 28, 2025, 10:58am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/11 "2025-09-28T10:58:55Z")

</div>

Here is a video of me scrolling from the bottom to the top of a topic on here.

The video is compressed but the flickering like mad is how it looks when you scroll! And as you can see on some of the page loads it jumps all over the place

This is with the latest iOS 26

Am I alone in experiencing this?

(I know this is slightly off topic but it’s all part of the terrible UX I’ve been getting lately on mobile safari)

---

<div class="post-metadata">

### Author: ![gingerbeardman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gingerbeardman/32/540824_2.png) [@gingerbeardman](https://meta.discourse.org/u/gingerbeardman)
#### Post date: [September 28, 2025, 11:26am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/12 "2025-09-28T11:26:29Z")

</div>

I don’t see that.

But I’m on iOS 18 on an iPhone 16 Pro.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 28, 2025, 11:31am UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/13 "2025-09-28T11:31:51Z")

</div>

No, you aren’t alone. I think it’s this:

> [@iOS 26 bugs with fixed position elements in Discourse](https://meta.discourse.org/t/ios-26-bugs-with-fixed-position-elements-in-discourse/382831):
>
> megaphone Update: with the release of iOS 26.1, Apple has solved the most critical bugs discussed in this topic. If you or your members are experiencing layout issues with Discourse on iOS, be sure the affected device is updated to 26.1 or later. [iOS 26](https://www.apple.com/os/ios/) has been officially released, but we recommend holding off on updating until some Safari issues are addressed. These are visual issues that cause fixed position elements on iPhones and iPads to be misplaced after opening the on-screen keybo…

So, 26.1 should help.

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [September 28, 2025, 2:29pm UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/14 "2025-09-28T14:29:57Z")

</div>

I’m not sure this is exclusively a iOS 26 problem because it’s not been great for a while now.

I’m on iPhone 16 Pro. Had lots of issues like this. Made worse now with the iOS 26 problems.

I just see things getting worse recently, not better.

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [September 28, 2025, 3:44pm UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/15 "2025-09-28T15:44:56Z")

</div>

You might be right. My iPhone is on 26 and it hasn’t any described symptomps. But I’ve never seen such symptomps on my iPhone & iPad with any OS either.

So, I would blame device here, unless there is some more specific details that differs between yous and mine systems 🤔

---

<div class="post-metadata">

### Author: ![Shauny](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shauny/32/362012_2.png) [@Shauny](https://meta.discourse.org/u/Shauny)
#### Post date: [September 28, 2025, 3:59pm UTC](https://meta.discourse.org/t/modal-input-fields-cause-page-jump-to-top-of-the-page/380187/16 "2025-09-28T15:59:08Z")

</div>

What could it be about my device that causes it though?!
