Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

iron-resize event does not correctly scroll to currently selected item #175

Open
1 of 8 tasks
shawncplus opened this issue Jul 11, 2016 · 1 comment
Open
1 of 8 tasks

Comments

@shawncplus
Copy link

shawncplus commented Jul 11, 2016

Description

paper-tabs inside a paper-toolbar inside a paper-header-panel. On load the tabs are hidden but have a default selected value (which happens to be the last and currently off-screen tab). On finishing load the paper-tabs are shown and I explicitly fire iron-resize on the paper-tabs element to force render of the scrollable arrows if necessary.

Expected outcome

iron-resize event and the subsequent call to _tabChanged() inside the _onResize() call should scroll to the currently selected item

Actual outcome

Does not scroll to the currently selected item

Live Demo

Reproduction JSBin: https://jsbin.com/fokuvo/edit?html,output

Resize your screen to about iphone size (375 width) to see the tab scrolly-ness

Possible fix

In userspace see my workaround (explicitly firing, iron-select as well as iron-resize), if it were to be fixed inside paper-tabs it looks like the fix is to simply pass the currently selected item as the "old" item in _onResize() i.e., _tabChanged(this.selectedItem, this.selectedItem);

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
@pomber
Copy link

pomber commented Aug 17, 2016

When should paper-tabs scroll to the selected tab?
I'm having a similar issue when having several tabs and the last one is selected declaratively.
Here is a demo: https://jsbin.com/ciqasuhici/2/edit?html,output

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants