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

Angular Material navbar broken on iOS #511

Closed
1 of 3 tasks
felepp opened this issue Oct 8, 2019 · 3 comments
Closed
1 of 3 tasks

Angular Material navbar broken on iOS #511

felepp opened this issue Oct 8, 2019 · 3 comments

Comments

@felepp
Copy link

felepp commented Oct 8, 2019

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

Navbar is invisible on iOS device(s) when using Angular Material. Buttons are invisible, but are still clickable and function normally. Using Bootstrap with fixed-top navbar is working as expected.

The issue seems to stem from the mat-sidenav setup and these styles inside of the header-/shell-component

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
}
.mat-sidenav,
.mat-drawer-content,
// Force style down to child components
// See https://angular.io/guide/component-styles#deep
:host ::ng-deep .mat-drawer-backdrop {
  top: 64px;
  bottom: 0;
  left: 0;
  right: 0;
  height: auto;
  position: absolute;
}

@media ($mat-xsmall) {
  .mat-sidenav,
  .mat-drawer-content,
  :host ::ng-deep .mat-drawer-backdrop {
    top: 56px;
  }
}

You can find many issues surrounding iOS and fixed elements. I've tried solutions to similar problems, but have reached the limitations of my CSS/Angular Material knowledge. If you don't have access to an iOS device, I'd be happy to test any possible solutions.

Expected behavior

Navbar should be visible.

Minimal reproduction of the problem with instructions

ngx new with Angular Material -> View on iOS device

Screenshot

Tested with Safari, Firefox and Chrome on iPhone 7 with current iOS.

Environment



ngX-Rocket: 7.1.0       
Node.js: v12.8.0        
Npm: 6.11.2
OS: win32 x64 10.0.18362

Generated project options: 
{
  "generator-ngx-rocket": {
    "version": "7.1.0",    
    "props": {
      "location": "path",  
      "strict": false,     
      "skipInstall": false,
      "skipQuickstart": false,
      "initGit": true,
      "appName": "ngx rocket test 2",
      "target": [
        "web"
      ],
      "pwa": true,
      "ui": "material",
      "layout": "simple",
      "auth": true,
      "lazy": true,
      "angulartics": false,
      "tools": [
        "prettier",
        "hads"
      ],
      "utility": [],
      "projectName": "ngx-rocket-test-2",
      "packageManager": "npm",
      "mobile": [],
      "desktop": []
    }
  }
}

Angular CLI: 8.1.3
Node: 12.8.0
OS: win32 x64
Angular: 8.2.9
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.3
@angular-devkit/build-angular     0.801.3
@angular-devkit/build-optimizer   0.801.3
@angular-devkit/build-webpack     0.801.3
@angular-devkit/core              8.1.3
@angular-devkit/schematics        8.1.3
@angular/cdk                      8.2.2
@angular/cli                      8.1.3
@angular/flex-layout              8.0.0-beta.27
@angular/material                 8.2.2
@ngtools/webpack                  8.1.3
@schematics/angular               8.1.3
@schematics/update                0.801.3
rxjs                              6.5.3
typescript                        3.4.5
webpack                           4.35.2


@felepp
Copy link
Author

felepp commented Oct 8, 2019

Ok, after some more googling, I found a workaround/solution. Now everything looks fine. Is there a reason this is not in the default template?

@sinedied
Copy link
Member

@tracyjordan Just that I did not have the chance to test the workaround and check that it does not break something else in the layout.
If you made some tests with it, you can always propose a pull request with the fix 😉

@sinedied
Copy link
Member

BTW, this is duplicate of #215

@sinedied sinedied closed this as completed Mar 3, 2020
sinedied pushed a commit that referenced this issue Mar 27, 2020
# [8.0.0](7.1.0...8.0.0) (2020-03-27)

### Bug Fixes

* broken template ([68d287e](68d287e))
* i18n for Electron ([15c7615](15c7615))
* i18n language imports ([0b8a1a6](0b8a1a6))
* ionic css import ([2a4b5cd](2a4b5cd))
* jest alias and update cases for prefix ([6f84b73](6f84b73))
* languages listing on windows ([37d5656](37d5656))
* material header not showing in cordova (close [#215](#215), [#511](#511)) ([2b78ff0](2b78ff0))
* misplaced prompt for puppeteer ([5cb4b60](5cb4b60))
* missing global mock when using Jest ([#509](#509)) ([32c69cf](32c69cf))
* stylelint issue ([451b47b](451b47b))
* template issues ([046fd48](046fd48))
* ts error with cordova ([9ae8b51](9ae8b51))
* webview config for ios/android (close [#491](#491)) ([79f4e49](79f4e49))

### Features

* add de-DE translation ([f08f6ec](f08f6ec))
* add deployment options (close [#540](#540), [#327](#327)) ([7602e8c](7602e8c))
* add i18n module and language selection at generation (close [#262](#262)) ([383d6fb](383d6fb))
* add prefix and aliasing for core/shared (close [#277](#277)) ([faa1981](faa1981))
* aggregate all auth related components in auth module (close [#535](#535)) ([8dbadb7](8dbadb7))
* make Angular Material the default UI for web apps ([626505c](626505c))
* remove HttpService and CacheService ([99eea62](99eea62))
* remove usage of puppeter by default for testing (fix [#522](#522)) ([b786c23](b786c23))
* update bootstrap template for ng9 ([88d3d58](88d3d58))
* update de-DE translation ([3c0b244](3c0b244))
* update to Ionic 5 ([589a1fb](589a1fb))
* upgrade to ng9 for material path ([97d8fb0](97d8fb0))

### BREAKING CHANGES

* core/shared folders now have an `@` prefix to have them listed first,
along with a direct TypeScript alias for imports.
* Removing HttpClient overload as this is definitely not something
the Angular team is looking to support. Also it's not relevant and
useful anymore thanks to state management libraries, that's why
CacheService is also removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants