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

$state.go fails to transition to the same state #1963

Closed
the-simian opened this issue May 19, 2015 · 4 comments
Closed

$state.go fails to transition to the same state #1963

the-simian opened this issue May 19, 2015 · 4 comments
Labels
Milestone

Comments

@the-simian
Copy link

If I am in a certain stay, such as x.y if I attempt to transition into the same state I am currently in, possibly with updated state params, the transition does not fire.

//in x.y
$state.go('x.y', { someParam: 'newvalue'}); //nothing happens

This occurs if reloadOnSearch is true (it should be by default anyways) and also if you set {reload: true}

//in x.y
$state.go('x.y', { someParam: 'newvalue'}, { reload: true}); //also nope

This occurs in 0.2.14, but not 0.2.13

@the-simian
Copy link
Author

references #1933

@the-simian
Copy link
Author

@christopherthielen

Ok I got it the bug repro working. It seems to be related, specifically to null being assigned to the value on a property of $stateParams. It turns out the application this was discovered in was doing exactly this. If you don't use null as a value, it seems to work

I made an example with both 0.2.13 and 0.2.14

Try clicking the buttons one after the other in each example/

The breaking code is the behavior of something like this:

  $state.go('default.search', {param1: 'yo2', param2: null})

In the past, setting a $stateParam to null would still change state, now it prevents a state change entirely.

Let me know if there's anything else I can do in this plunkr setup to help demonstrate the problem. Its somewhat hard to really show, because its hard to see the url itself in the plunkr. I seem to recall setting a $stateParam to null removing it entirely from the url.

@christopherthielen
Copy link
Contributor

This is caused by the 'string' param Type .is() method changing from regexp test to typeof(val) === 'string'. I hadn't intended to change the behavior of string Type until a breaking change release. Sorry about that. 0.2.15 will make string types optional once more.

@the-simian
Copy link
Author

@christopherthielen Thanks for looking into this! Let me know if there's anything else I can do to help out!

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

No branches or pull requests

2 participants