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

Problem with ui-sref-active and ui-grid #2554

Closed
pgrm opened this issue Feb 13, 2016 · 5 comments
Closed

Problem with ui-sref-active and ui-grid #2554

pgrm opened this issue Feb 13, 2016 · 5 comments
Labels
Milestone

Comments

@pgrm
Copy link

pgrm commented Feb 13, 2016

I have following scenario (using angular 1.5):

  • one long list with items. Can have up to ~a hundred items, implemented with ui-grid.
  • each row in this list is a link to the details of the item, which show up as a nested view above that list
    • this means, each row has a ui-sref=".details({id: row.entity.id})" - and this part works great (as far as I could see / test it
    • additionally, each row also has ui-sref-active="active-class-name" - and this doesn't work

When I scroll inside a long grid, random rows start popping up as selected.

I'm not entirely sure the bug is in ui-router and not angular-ui, this is just a feeling. Maybe somebody else had a similar setup and it worked? I'd like to hear about how to get it to work.

Thx

@nateabele
Copy link
Contributor

Please post a plunkr that demonstrates the issue. Thanks.

@pgrm
Copy link
Author

pgrm commented Feb 14, 2016

@nateabele I'm currently working on a plunkr - in the meanwhile I wanted to share some findings:

while I scroll through the grid, the states-array from stateDirectives#L371 becomes longer and longer. Eventually containing every possible state, which is, why they get marked as selected.

Does this sound valid to you?

Plunkr which reproduces that behavior will follow ASAP (hopefully)

@pgrm
Copy link
Author

pgrm commented Feb 14, 2016

@nateabele plunkr is here: https://plnkr.co/edit/JNtNqMgcd4fGR01bnxZ8?p=preview

you need to scroll around for a while to start seeing the problem. you can also select different items. The faster you scroll around the sooner it will start to appear.

@christopherthielen
Copy link
Contributor

Does this sound valid to you?

no

christopherthielen added a commit that referenced this issue Feb 14, 2016
When ui-state dynamicly changes watchers, make sure to update the ui-sref-active/eq
Clear out old previous registered values.
Closes #2554
@christopherthielen christopherthielen added this to the 0.2.19 milestone Feb 14, 2016
@christopherthielen
Copy link
Contributor

christopherthielen added a commit that referenced this issue Feb 14, 2016
When ui-state dynamicly changes watchers, make sure to update the ui-sref-active/eq
Clear out old previous registered values.
Closes #2554
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

3 participants