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

tabs: wrong tab position when a new tab is added #11689

Closed
Axeldorf opened this issue Mar 21, 2019 · 4 comments · Fixed by #11711
Closed

tabs: wrong tab position when a new tab is added #11689

Axeldorf opened this issue Mar 21, 2019 · 4 comments · Fixed by #11711
Assignees
Labels
has: Pull Request A PR has been created to address this issue P1: urgent Urgent issues that should be addressed in the next minor or patch release. resolution: fixed severity: regression This issue is related to a regression type: bug
Milestone

Comments

@Axeldorf
Copy link

Bug, enhancement request, or proposal:

There is an error with tabs position when you add a new tab and it does not fit and needs to be horizontally scrolled.

CodePen and steps to reproduce the issue:

CodePen Demo which demonstrates the issue:

Detailed Reproduction Steps:

  1. Go to https://material.angularjs.org/HEAD/demo/tabs
  2. Go to "Dyanmic tabs" block.
  3. Add a new tab with any label and any content.

What is the expected behavior?

A new tab is created and tabs are scrolled to it. Then you can go back with the left arrow until first tab.

What is the current behavior?

A new tab is created and tabs are scrolled to it. You cannot see any tab until you click on left arrow, then you see some tabs and you cannot go to previous tabs.

What is the use-case or motivation for changing an existing behavior?

I want to create new tabs dynamically and I want to be able to go to first tab.

Which versions of AngularJS, Material, OS, and browsers are affected?

  • AngularJS: 1.7.5
  • AngularJS Material: 1.1.14
  • OS: Ubuntu 18.04
  • Browsers: Chome v72.0.3626.119

Is there anything else we should know? Stack Traces, Screenshots, etc.

This bug occurs since AngularJS Material v1.1.11, with v1.1.10 it is working correctly.

@Splaktar Splaktar added severity: regression This issue is related to a regression P1: urgent Urgent issues that should be addressed in the next minor or patch release. labels Mar 28, 2019
@Splaktar Splaktar self-assigned this Mar 28, 2019
@Splaktar Splaktar added this to the 1.1.15 milestone Mar 28, 2019
@Splaktar Splaktar added type: bug needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community labels Mar 28, 2019
@Splaktar
Copy link
Member

Thank you for this report! We'll work on a fix for this ASAP!

@Splaktar
Copy link
Member

This is caused by this line in 1.1.11

width: 999999px;

and this block in 1.1.12

// Work around width calculation issues on IE11 when pagination is enabled
if (shouldPaginate) {
getElements().paging.style.width = '999999px';
} else {
getElements().paging.style.width = undefined;
}

@Splaktar
Copy link
Member

Splaktar commented Apr 19, 2019

These are both (PR #11432 and PR #11567) a result of the need to fix this regression in IE with pagination.

We had better fixes that didn't use 999999px in PR #11432, but they caused too many problems in the Google presubmits. So we had to fall back to this solution.

@Splaktar Splaktar changed the title dynamic tabs: wrong tab position when a new tab is added tabs: wrong tab position when a new tab is added Apr 19, 2019
Splaktar added a commit that referenced this issue Apr 19, 2019
@Splaktar
Copy link
Member

OK, f2dbe07 will fix this for browsers other than IE11. IE11 still needs this 999999px hack to make pagination usable (avoid all labels being truncated to 1 character and ...).

  • Investigate how to fix/disable animations on IE11 while keeping pagination working

@Splaktar Splaktar added has: Pull Request A PR has been created to address this issue and removed needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community labels Apr 19, 2019
mmalerba pushed a commit that referenced this issue Apr 23, 2019
<!-- 
Filling out this template is required! Do not delete it when submitting a Pull Request! Without this information, your Pull Request may be auto-closed.
-->
## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [ ] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
<!-- Please check the one that applies to this PR using "x". -->
```
[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?
The scroll to new tab animation is broken.
<!-- Please describe the current behavior that you are modifying and link to one or more relevant issues. -->
Issue Number: 
Fixes #11689

## What is the new behavior?
The scroll to new tab animation is fixed for browsers other than IE.

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P1: urgent Urgent issues that should be addressed in the next minor or patch release. resolution: fixed severity: regression This issue is related to a regression type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants