Skip to content
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

Fix tab pagination controls #1068

Closed
wants to merge 1 commit into from

Conversation

pauln
Copy link
Contributor

@pauln pauln commented Feb 21, 2019

Fixes #1063.

There were two main issues:

  • fixOffsetIfNeeded() had been added into updateCanvasWidth, so it was being called on every render. This means that it ran after the nextPage action, and effectively reverted the pagination offset change because it doesn't know/care about pagination (only the selected tab)
  • fixOffsetIfNeeded() was setting this.currentOffset to undefined in some situations, which then prevented pagination from working as it's used in calculations

In order to address these issues, I've removed fixOffsetIfNeeded() from updateCanvasWidth (it seems to be being called directly where needed already) and defaulted newOffset to currentOffset in fixOffsetIfNeeded(). I've done some manual testing in addition to running the automated tests, and all seems well.

Fixes adopted-ember-addons#1063 by stopping currentOffset from being set to undefined, and preventing fixOffsetIfNeeded() from being run on every render.
@pauln
Copy link
Contributor Author

pauln commented Feb 21, 2019

Closing in favour of #1048, which I noticed after submitting this PR - and have since tested and confirmed that it fixes (for me, at least) both #1063 and #893, which was next on my hit list.

@pauln pauln closed this Feb 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

paper-tabs: arrows to scroll on overflowing tabs are always disabled
1 participant