ionic-team / ionic-team/ionic-framework

bug: <ion-back-button> going back removes previously set search parameters

Open
#21,086 1 comment 1 reaction 0 assignees View on GitHub
package: core type: bug
Dominant language
TypeScript
Stars
52.7k
Forks
13.3k
Avg merge
1d 15h
Merged PRs (30d)
51

Description

# Bug Report

**Version(s):**
Ionic: **5.0.7**
Stencil: **1.12.4**

**Current behavior:**

Using the stencil ionic pwa starter, starting at the home component with a url that has search parameters:

`http://localhost:3333/?name=value`

Navigate to the profile page:

`http://localhost:3333/profile/ionic`

Then use `` to navigate back:

`http://localhost:3333`

**Expected behavior:**

Maintain the query parameters when navigating back (if possible):

`http://localhost:3333/?name=value`

**Other information:**

Here is a repo, its a modified ionic pwa starter, with a searchbar at the top of the home layout to change query props:

https://github.com/ajmchambers/ionic-router-example-2

![back-button](https://user-images.githubusercontent.com/5426717/79799067-c93c8e00-8351-11ea-8417-ec7c2fe3d235.gif)

Not really sure what the intended behaviour should be for the `` so this may be considered a feature request rather than a bug.

The back button seems to use `` to go back, maybe the search parameter string at the time of navigating could be added into the view history or something like that.

Contributor guide

Open the contributing guide

Research direction

Reproduce the navigation flow in the linked ionic-router-example-2 repository, starting at the query-parameter URL and using ion-back-button to return from the profile page. Read the ion-back-button and ion-nav navigation behavior; done means returning to the home page preserves the original query parameters, with the intended behavior confirmed by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.