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

bug(mat-tab-group): inner div cannot cover 100% of viewport, on iphone #18883

Open
yanivamrami opened this issue Mar 22, 2020 · 2 comments
Open
Labels
area: material/tabs ios Issues specific to iOS needs investigation A member of the team needs to do further investigation to determine the root cause P4 A relatively minor issue that is not relevant to core functions

Comments

@yanivamrami
Copy link

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/fork/components-issue
StackBlitz to reproduce:
https://stackblitz.com/edit/components-issue-dssxxk
or
https://stackblitz.com/edit/angular-3qr9lv

Attention - this will reproduce only on iOS (e.g. iPhone) with both Chrome and Safari.
On Android it works perfectly.
On computer with Chrome and F12 on - it works perfectly.

Steps to reproduce:

  1. Create mat-tab-group with few mat-tab children.
  2. Inside one of the children, set a div with 100% height, 100% width, fixed position, with top, right equal to zero and a high z-index. Also, set it with a background-color (e.g. blue) to easily reproduce the behavior.

Expected Behavior

What behavior were you expecting to see?
The created div should cover ALL viewport (top to bottom, right to left), including the mat-tab, mat-tab-group and any other components on the HTML page (e.g. navbar etc.)
In other words - all screen will be blue.

Actual Behavior

What behavior did you actually see?
The created div covers the entire page, but you cannot see it, although it has a blue background, the blue color appears only within the mat-tab. above the mat-tab it doesn't show the blue background, yet it covers the elements (e.g. if you have a button above the mat-tab-group, you cannot click it)

Environment

  • Angular: 8
  • CDK/Material: 8
  • Browser(s): chrome, safari
  • Operating System (e.g. Windows, macOS, Ubuntu): iOS
@yanivamrami yanivamrami added the needs triage This issue needs to be triaged by the team label Mar 22, 2020
@crisbeto
Copy link
Member

This sounds like some kind of browser rendering bug. It might be worth trying to add transform: translateZ(0) to your element.

@yanivamrami
Copy link
Author

Hi, thanks for the input.

I have tried to add the code you mentioned on my DIV, it didn't work...

I did, however, found a workaround. It appears the mat-tab's overflow is causing this issue. I found the workaround here on GitHub (#16283) and gave it a try:
.tab-custom-overflow .mat-tab-body-wrapper, .tab-custom-overflow .mat-tab-body-active, .tab-custom-overflow .mat-tab-body-content { overflow: visible !important; }
it appears to be working. Still:

  1. Why it works perfectly on Chrome on desktop and Android devices, without this workaround?
  2. This is a workaround. Not a solution. As a result, the tab animation doesn't look good.

Thanks

@mmalerba mmalerba added area: material/tabs ios Issues specific to iOS needs investigation A member of the team needs to do further investigation to determine the root cause labels Jun 5, 2020
@andrewseguin andrewseguin added this to Backlog in Andrew's Triage Jul 10, 2020
@andrewseguin andrewseguin moved this from Backlog to Triaging in Andrew's Triage Jul 10, 2020
@andrewseguin andrewseguin added P4 A relatively minor issue that is not relevant to core functions and removed needs triage This issue needs to be triaged by the team labels Jul 10, 2020
@andrewseguin andrewseguin moved this from Triaging to Done in Andrew's Triage Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/tabs ios Issues specific to iOS needs investigation A member of the team needs to do further investigation to determine the root cause P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

4 participants