-
Notifications
You must be signed in to change notification settings - Fork 311
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
Remove app-scroll-position #417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this too:
Line 26 in 4dd4304
'../app-scroll-position/test/index.html', |
@@ -131,9 +130,6 @@ | |||
</app-header-layout> | |||
</app-drawer> | |||
|
|||
<app-scroll-position | |||
selected="[[_pageData.page]]" | |||
reset="[[_isDetailPage(_pageData.page)]]"></app-scroll-position> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add some JS code to save the scroll position so if you navigate back to the list page you are at the previous scroll position. This code will serve as a sample for users for replacing app-scroll-position
element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -29,7 +29,6 @@ | |||
<link rel="import" href="../bower_components/app-layout/app-header/app-header.html"> | |||
<link rel="import" href="../bower_components/app-layout/app-header-layout/app-header-layout.html"> | |||
<link rel="import" href="../bower_components/app-layout/app-toolbar/app-toolbar.html"> | |||
<link rel="import" href="../bower_components/app-layout/app-scroll-position/app-scroll-position.html"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this old <app-scrollpos-control>
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
PTAL |
templates/pesto/src/recipe-app.html
Outdated
@@ -118,21 +126,28 @@ | |||
|
|||
<!-- nav menu --> | |||
<paper-listbox | |||
selected="{{_pageData.page}}" | |||
selected="[[_pageData.page]]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why there needs to be a separate _selectedPage
property, but why does this need to change to one-way bound _pageData.page
with <a>
links for navigation? This is an issue if a user clicks on the <paper-item>
outside of the <a>
(where the paper-item gets selected, but the link isn't clicked).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's a bug in Polymer 2.0 that causes a notification to be missed. I will file the bug as soon as I can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment with a TODO that we should change this back once the issue in Polymer2 is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a tracking issue in polymer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will file the bug asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done tracking issue is: Polymer/polymer#4405
templates/pesto/src/recipe-app.html
Outdated
} | ||
this._selectedPage = pageData.page; | ||
if (map[pageData.page] != null) { | ||
window.scrollTo(0, map[pageData.page]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Polymer.AppLayout.scroll({ top: scrollTop, behavior: 'silent' });
if (map[subroute.prefix] != null) { | ||
window.scrollTo(0, map[subroute.prefix]); | ||
} else if (this.isAttached) { | ||
window.scrollTo(0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use Polymer.AppLayout.scroll({ top: scrollTop, behavior: 'silent' });
interesting... any other way to have a more flexible implementation? |
@MeTaNoV We feel that there isn't a guaranteed way to make this element works reliably because to save the current scroll position it needs to do that before the page visibility changes. Ideally it should be handled inside app-layout/templates/pesto/src/recipe-app.html Lines 238 to 250 in 757d1fd
|
thx @frankiefu for your answer, I agree that it should be handled in any since there is not only |
@MeTaNoV Yeah, a behavior makes a lot of sense. Good suggestion! |
No description provided.