Skip to content

Asynchronous routes cause wonky link-to behaviour when nested #10366

Closed
@markprzepiora

Description

@markprzepiora

A pattern I previously used to mark an outer HTML tag as active or not (e.g. an <li> tag) rather than the link itself, is something like this:

  {{#link-to "foo" tagName="li"}}
    {{#link-to "foo"}}
      foo
    {{/link-to}}
  {{/link-to}}

This has worked perfectly fine going back to I think even before 1.0. But this is now broken in 1.11 canary (still works fine in the current 1.10 beta). When the foo route is asynchronous, clicking on it transitions the page perfectly fine, but the active classes are not updated.

The solution is to add bubbles=false to the inner link-tos, like so:

  {{#link-to "foo" tagName="li"}}
    {{#link-to "foo" bubbles=false}}
      foo
    {{/link-to}}
  {{/link-to}}

This is a regression, but is it an expected one? I'm sure that changing the tagName of a link-to isn't exactly an intended API, but I know this is a pattern that's used in the wild, so I just wanted to bring it to your attention.

It should be noted that synchronous transitions to not exhibit this problem.

JSBin here: http://emberjs.jsbin.com/jahuya/5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions