-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Trying to address paper-tabs issues #1048
Trying to address paper-tabs issues #1048
Conversation
edit: worked around by not calling 'fixOffset' in didRender |
1 similar comment
edit: worked around by not calling 'fixOffset' in didRender |
Doing this avoid, on render where the selected tab is NOT the first tab, to have the inkBar quickly starting from offset 0 to the actual selected tab.
By defaults, assume this is true.
This is unnecessary because we already have the hook in paper-tabs that: - is always called after one of the tab didRender - calls 'updateDimensions' on all of its children
As it will be done directly after in didRender
Because didRender will be called and will call this method too.
Because when navigating there is a render without any selected tab
Because we pass 'selected' to each of them, updating the selected tab will invalidate all the 'isSelected' property which will trigger an validation of _selectedTab (thus observer callback) for each nested tab
Only do it in two occasions: - first render - selected tab was updated Otherwise it will prevent user's pagination as the selected tab will become partially hidden.
5cf4149
to
2476826
Compare
@panthony I pulled in your changes into a project and it resolved an issue for me where the next/previous buttons were disabled when they shouldn't have been. I'll do some more testing, but I see no issues so far. |
@panthony sorry for the delay, I also pulled your tag and it works, gonna keep testing my use cases, and will let you know, thanks for the effort |
I spotted this PR after submitting my own to fix the pagination issues. I can confirm that this fixes #1063 for me, as well as the other issues listed in the OP. |
Thanks a lot @panthony. Sorry for taking so long to review. This looks great! |
Hopefully:
I'm trying to take a fresh start at paper tabs offsets handling as they are may issues at the moment.
If they are things that I'm missing feel free to tell me.
Amongs the hopefully fixed issues:
Issues yet to be fixed:
edit:
To correct this 'fixOffset' issue that breaks the pagination I now call it in only 2 cases:
I'm not calling it anymore in 'didRender' which means that if the tab's label is updated while selected it might become partially hidden but this is way WAY minor IMO.
edit²:
Unfortunately I do not have time for this right away but I think we should add some tests with a wrapper around "paper-tabs" with a small max width, to ensure that we can still paginate around.