# Cannot use back button to exit Site Settings

**URL:** <https://meta.discourse.org/t/cannot-use-back-button-to-exit-site-settings/58824>\
**Category:** Bug\
**Created:** [March 10, 2017, 2:41pm UTC](https://meta.discourse.org/t/cannot-use-back-button-to-exit-site-settings/58824 "2017-03-10T14:41:04Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [March 10, 2017, 2:41pm UTC](https://meta.discourse.org/t/cannot-use-back-button-to-exit-site-settings/58824/1 "2017-03-10T14:41:04Z")

</div>

The following sequence traps you in site settings

- Click hamburger
- Click Site Settings
- Type “Test” in box
- Click back → back → back → …

This raises two issues:

- We are way way too eager on `pushState` here, we should be using `replaceState` most of the time. Typing test should not push 4 states into my stack

- We should not be trapped 🙂

---

<div class="post-metadata">

**Author:** ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)\
**Post date:** [March 10, 2017, 2:51pm UTC](https://meta.discourse.org/t/cannot-use-back-button-to-exit-site-settings/58824/3 "2017-03-10T14:51:34Z")

</div>

I am getting similar problem when using Google Analytics. In both “Site setting” or “customize/site\_texts” if I type “welcome” and backspace it to empty then suddenly I get 12 pageviews in Analytics real-time report. By typing “welcome” it takes 6 `pushState`.

But it is really a minor issue. Since it only happening in Admin side.

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [March 21, 2017, 8:15pm UTC](https://meta.discourse.org/t/cannot-use-back-button-to-exit-site-settings/58824/4 "2017-03-21T20:15:45Z")

</div>

I’ve fixed @sam’s initial issues in this commit:

[https://github.com/discourse/discourse/commit/1cd14ef3aa352a8b9d832eca049fbabdefae73e8](https://github.com/discourse/discourse/commit/1cd14ef3aa352a8b9d832eca049fbabdefae73e8)

> [@vinothkannans](#):
>
> By typing “welcome” it takes 6 pushState.

In site settings it was indeed using `pushState` which has now been fixed. However, for site texts it should have always used replaceState.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [April 28, 2017, 2:34am UTC](https://meta.discourse.org/t/cannot-use-back-button-to-exit-site-settings/58824/5 "2017-04-28T02:34:00Z")

</div>


