Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

{{#link-to}} 'active' class present on incorrect links #4522

Closed
GavinJoyce opened this Issue · 7 comments

5 participants

@GavinJoyce

There seems to be an active link bug in Ember 1.5.0.beta-4 where too many links have the active class.

Ember v1.4

http://emberjs.jsbin.com/tedem/2#/people

image

Ember v1.5.beta.4

Notice that when you click a person, all people links have the active class:

http://emberjs.jsbin.com/tedem/3#/people

image

EDIT

Here is a jsbin using Ember Canary to demonstrate the bug:

http://emberjs.jsbin.com/tedem/4#/people

@GavinJoyce

Possibly related to #4277, although my examples don't have query params enabled.

@GavinJoyce

This only happens when the resource has a supplied function.

This exhibits the bug:

App.Router.map(function() {
  this.resource('people', { path: 'people' }, function() {
    this.resource('people.person', { path: ':person_id' }, function() {

    });
  });
});

This does not exhibit the bug:

App.Router.map(function() {
  this.resource('people', { path: 'people' }, function() {
    this.resource('people.person', { path: ':person_id' });
  });
});
@josbeir

I'm glad you pointed this out as i thought i was doing something wrong :-).
I confirm this is happing in ember-1.5.0-beta4 (and since beta1) and not happing in 1.4.0

@rwjblue
Owner

@machty - Thoughts? I'd hate to ship 1.5.0 with this bug if it is feasible to fix...

@rwjblue rwjblue added the bug label
@raytiley

I just confirmed that this PR: #4376 fixes this issue.

The problem is that the link to people.person is really a link to people.person.index. Currently the passed in context is dropped when a link-to does not link directly to a leaf route. The linked PR changes that behavior.

@machty
Owner

Thanks @raytiley. This is closed by #4376

@machty machty closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.