Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Off by one error in replace #31

Closed
notquiteamonad opened this issue Jun 21, 2020 · 1 comment · Fixed by #32
Closed

Off by one error in replace #31

notquiteamonad opened this issue Jun 21, 2020 · 1 comment · Fixed by #32

Comments

@notquiteamonad
Copy link
Contributor

My understanding of the replace function on BackStack is that it should swap the item at the top of the stack, so if the routing is a,b,c and replace(d) is called it should become a,b,d.

However, the replace function uses .subList(0, elements.lastIndex - 1) which removes 2 elements (the second argument being exclusive).

This should probably either change to use size or remove the -1 (the latter makes more sense to me).

This is, of course, all invalid if I've misunderstood what replace is supposed to do.

@zsoltk
Copy link
Owner

zsoltk commented Jun 23, 2020

Thanks @samueldple! Released fix as 0.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants