propsHistory

Open Beginner friendly
#4,347 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
javascript
Domain
frontend, mobile

Research direction

Start in src/core/modules/router/swipe-back.js around line 265, then compare the swipe-back flow with the router.back() behavior described in the issue. Use the provided CodeSandbox to reproduce navigation with route props. Done means swipe-back removes the corresponding propsHistory entry and no longer corrupts subsequent route props.

Written by the indexing model from the issue text.

Description

Describe the bug

keep router props history if page was loaded with passed props.

it was fixed here: https://github.com/framework7io/framework7/commit/5ad3d8a995ab303a76c0f50ceae58af39426c8dd (committed on Jan 20, 2023)
but it is still a bug when user swipe-back.

in other words: when user "go back" (router.back()), everything is ok (namely: router.propsHistory.pop();).
but when user swipe-back "it" doesn't "pop" propsHistory (which will cause a mess in route-props).
all we need is this line: router.propsHistory.pop(); (or router.propsHistory.length = router.history.length)
exactly right after this line: https://github.com/framework7io/framework7/blob/3408af380c4f4252deff791e8421ae73d7afd5d6/src/core/modules/router/swipe-back.js#L265

Dominant language
JavaScript
Stars
18.8k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from framework7io/framework7

All issues in framework7io/framework7

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.