app-route icon indicating copy to clipboard operation
app-route copied to clipboard

Suggestion - Add route to document.title for easy navigation on browser back/forward buttons.

Open Where-Solutions opened this issue 9 years ago • 2 comments

Hi, I made this small change, but maybe it should be standard feature:

<carbon-route route="{{route}}"


ws.title = document.title; // Global

...

properties:{
  route: {
    observer: '_setTitle'
    }
  },

...

 _setTitle: function(newValue, oldValue){
    document.title = ws.title + newValue.path;
  },

Or is there a better way to do this.

Where-Solutions avatar Apr 12 '16 00:04 Where-Solutions

I think the idea of binding to the document title is interesting, I do not think this should be included into carbon-route in this manner. This will break with nesting carbon-route resulting in inconsistent behavior.

It might be an idea to create a separate element for this that could be attached to a carbon-location which can implement this behavior. That would be :+1: for me

TimvdLippe avatar Apr 12 '16 17:04 TimvdLippe

Given the way that document.title integrates with history, something keep the title up to date makes sense to me. It may make sense to put this all the way up with iron-location.

rictic avatar Apr 14 '16 18:04 rictic