mat-raised-button not working on Safari browser when using CSS Grid (Angular 6 with Angular Material)












0















My Template Code:



<div>
<div class="margin-top-title">
<div>
<h1>Test</h1>
</div>
</div>
<form>
<div *ngIf="true">
<div>
<div style="height: 2000px">test</div>
</div>
</div>
<div>
<div>
<button (click)="click()">
Test Button
</button>

<button mat-flat-button color="primary" (click)="click()">
Material Flat Test Button
</button>

<button mat-raised-button color="primary" (click)="click()">
Material Raised Test Button
</button>
</div>
</div>
</form>

</div>


My Component:



import {Component, OnInit} from '@angular/core';

@Component({
selector: 'testdaten',
templateUrl: './testdaten.component.html',
styleUrls: ['./testdaten.component.scss'],
})
export class TestdatenComponent implements OnInit {

constructor() {
}

public ngOnInit(): void {
}

public click(): void {
alert('click');
}
}


As soon i need to scroll to reach the button in Safari Browser the raised-button is not working. If i click on the raised-button the Safari browser is just scroll to top. The function will not called! (Even if i use NoopAnimationsModule)
With mat-flat-button everything works fine!



Here is my Stackblitz example



https://stackblitz.com/edit/angular-m5f2wl-h1tz3s



Any ideas to fix that?



I'm using:



"@angular/animations": "6.1.3",



"@angular/common": "6.1.3",



"@angular/material": "~6.4.6",



My Workaround



grid-template-rows: $menubar-hight 1fr $footer-hight; on my app.component.html does make the problem in Safari. (I don't know why)



My Solution is using CSS switch only for Safari



.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight 1fr $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}

/*Safari only override*/
@media not all and (min-resolution:0.001dpcm)
{ @supports (-webkit-appearance:none) and (stroke-color:transparent) {
.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight auto $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}
}
}









share|improve this question

























  • I am using Safari. See your example here: stackblitz.com/edit/angular-m5f2wl

    – Maihan Nijat
    Nov 27 '18 at 13:37











  • I see your stackbitz example is working. In my project, as soon i have any animations, Safari is broken. With all other browsers there are no such problems...

    – Gatschet
    Nov 27 '18 at 14:56











  • @MaihanNijat I also use css-grid in my project. As soon i delete display: grid it's working too... I need to verification, what's wrong...

    – Gatschet
    Nov 27 '18 at 15:53











  • Upload to stackblitz so I have a look.

    – Maihan Nijat
    Nov 27 '18 at 16:03











  • @MaihanNijat I updated my request with a stackblitz example which is not working when using the mat-raised-button on Safari (or any other animated material component like an input). Thanks for your help!

    – Gatschet
    Nov 28 '18 at 7:34


















0















My Template Code:



<div>
<div class="margin-top-title">
<div>
<h1>Test</h1>
</div>
</div>
<form>
<div *ngIf="true">
<div>
<div style="height: 2000px">test</div>
</div>
</div>
<div>
<div>
<button (click)="click()">
Test Button
</button>

<button mat-flat-button color="primary" (click)="click()">
Material Flat Test Button
</button>

<button mat-raised-button color="primary" (click)="click()">
Material Raised Test Button
</button>
</div>
</div>
</form>

</div>


My Component:



import {Component, OnInit} from '@angular/core';

@Component({
selector: 'testdaten',
templateUrl: './testdaten.component.html',
styleUrls: ['./testdaten.component.scss'],
})
export class TestdatenComponent implements OnInit {

constructor() {
}

public ngOnInit(): void {
}

public click(): void {
alert('click');
}
}


As soon i need to scroll to reach the button in Safari Browser the raised-button is not working. If i click on the raised-button the Safari browser is just scroll to top. The function will not called! (Even if i use NoopAnimationsModule)
With mat-flat-button everything works fine!



Here is my Stackblitz example



https://stackblitz.com/edit/angular-m5f2wl-h1tz3s



Any ideas to fix that?



I'm using:



"@angular/animations": "6.1.3",



"@angular/common": "6.1.3",



"@angular/material": "~6.4.6",



My Workaround



grid-template-rows: $menubar-hight 1fr $footer-hight; on my app.component.html does make the problem in Safari. (I don't know why)



My Solution is using CSS switch only for Safari



.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight 1fr $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}

/*Safari only override*/
@media not all and (min-resolution:0.001dpcm)
{ @supports (-webkit-appearance:none) and (stroke-color:transparent) {
.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight auto $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}
}
}









share|improve this question

























  • I am using Safari. See your example here: stackblitz.com/edit/angular-m5f2wl

    – Maihan Nijat
    Nov 27 '18 at 13:37











  • I see your stackbitz example is working. In my project, as soon i have any animations, Safari is broken. With all other browsers there are no such problems...

    – Gatschet
    Nov 27 '18 at 14:56











  • @MaihanNijat I also use css-grid in my project. As soon i delete display: grid it's working too... I need to verification, what's wrong...

    – Gatschet
    Nov 27 '18 at 15:53











  • Upload to stackblitz so I have a look.

    – Maihan Nijat
    Nov 27 '18 at 16:03











  • @MaihanNijat I updated my request with a stackblitz example which is not working when using the mat-raised-button on Safari (or any other animated material component like an input). Thanks for your help!

    – Gatschet
    Nov 28 '18 at 7:34
















0












0








0








My Template Code:



<div>
<div class="margin-top-title">
<div>
<h1>Test</h1>
</div>
</div>
<form>
<div *ngIf="true">
<div>
<div style="height: 2000px">test</div>
</div>
</div>
<div>
<div>
<button (click)="click()">
Test Button
</button>

<button mat-flat-button color="primary" (click)="click()">
Material Flat Test Button
</button>

<button mat-raised-button color="primary" (click)="click()">
Material Raised Test Button
</button>
</div>
</div>
</form>

</div>


My Component:



import {Component, OnInit} from '@angular/core';

@Component({
selector: 'testdaten',
templateUrl: './testdaten.component.html',
styleUrls: ['./testdaten.component.scss'],
})
export class TestdatenComponent implements OnInit {

constructor() {
}

public ngOnInit(): void {
}

public click(): void {
alert('click');
}
}


As soon i need to scroll to reach the button in Safari Browser the raised-button is not working. If i click on the raised-button the Safari browser is just scroll to top. The function will not called! (Even if i use NoopAnimationsModule)
With mat-flat-button everything works fine!



Here is my Stackblitz example



https://stackblitz.com/edit/angular-m5f2wl-h1tz3s



Any ideas to fix that?



I'm using:



"@angular/animations": "6.1.3",



"@angular/common": "6.1.3",



"@angular/material": "~6.4.6",



My Workaround



grid-template-rows: $menubar-hight 1fr $footer-hight; on my app.component.html does make the problem in Safari. (I don't know why)



My Solution is using CSS switch only for Safari



.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight 1fr $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}

/*Safari only override*/
@media not all and (min-resolution:0.001dpcm)
{ @supports (-webkit-appearance:none) and (stroke-color:transparent) {
.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight auto $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}
}
}









share|improve this question
















My Template Code:



<div>
<div class="margin-top-title">
<div>
<h1>Test</h1>
</div>
</div>
<form>
<div *ngIf="true">
<div>
<div style="height: 2000px">test</div>
</div>
</div>
<div>
<div>
<button (click)="click()">
Test Button
</button>

<button mat-flat-button color="primary" (click)="click()">
Material Flat Test Button
</button>

<button mat-raised-button color="primary" (click)="click()">
Material Raised Test Button
</button>
</div>
</div>
</form>

</div>


My Component:



import {Component, OnInit} from '@angular/core';

@Component({
selector: 'testdaten',
templateUrl: './testdaten.component.html',
styleUrls: ['./testdaten.component.scss'],
})
export class TestdatenComponent implements OnInit {

constructor() {
}

public ngOnInit(): void {
}

public click(): void {
alert('click');
}
}


As soon i need to scroll to reach the button in Safari Browser the raised-button is not working. If i click on the raised-button the Safari browser is just scroll to top. The function will not called! (Even if i use NoopAnimationsModule)
With mat-flat-button everything works fine!



Here is my Stackblitz example



https://stackblitz.com/edit/angular-m5f2wl-h1tz3s



Any ideas to fix that?



I'm using:



"@angular/animations": "6.1.3",



"@angular/common": "6.1.3",



"@angular/material": "~6.4.6",



My Workaround



grid-template-rows: $menubar-hight 1fr $footer-hight; on my app.component.html does make the problem in Safari. (I don't know why)



My Solution is using CSS switch only for Safari



.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight 1fr $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}

/*Safari only override*/
@media not all and (min-resolution:0.001dpcm)
{ @supports (-webkit-appearance:none) and (stroke-color:transparent) {
.my-wrapper {
display: grid;
grid-template-rows: $menubar-hight auto $footer-hight;
grid-template-columns: 1fr;
grid-template-areas: 'header' 'content' 'footer ';
}
}
}






angular safari angular-material






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 28 '18 at 10:29







Gatschet

















asked Nov 27 '18 at 13:24









GatschetGatschet

5311131




5311131













  • I am using Safari. See your example here: stackblitz.com/edit/angular-m5f2wl

    – Maihan Nijat
    Nov 27 '18 at 13:37











  • I see your stackbitz example is working. In my project, as soon i have any animations, Safari is broken. With all other browsers there are no such problems...

    – Gatschet
    Nov 27 '18 at 14:56











  • @MaihanNijat I also use css-grid in my project. As soon i delete display: grid it's working too... I need to verification, what's wrong...

    – Gatschet
    Nov 27 '18 at 15:53











  • Upload to stackblitz so I have a look.

    – Maihan Nijat
    Nov 27 '18 at 16:03











  • @MaihanNijat I updated my request with a stackblitz example which is not working when using the mat-raised-button on Safari (or any other animated material component like an input). Thanks for your help!

    – Gatschet
    Nov 28 '18 at 7:34





















  • I am using Safari. See your example here: stackblitz.com/edit/angular-m5f2wl

    – Maihan Nijat
    Nov 27 '18 at 13:37











  • I see your stackbitz example is working. In my project, as soon i have any animations, Safari is broken. With all other browsers there are no such problems...

    – Gatschet
    Nov 27 '18 at 14:56











  • @MaihanNijat I also use css-grid in my project. As soon i delete display: grid it's working too... I need to verification, what's wrong...

    – Gatschet
    Nov 27 '18 at 15:53











  • Upload to stackblitz so I have a look.

    – Maihan Nijat
    Nov 27 '18 at 16:03











  • @MaihanNijat I updated my request with a stackblitz example which is not working when using the mat-raised-button on Safari (or any other animated material component like an input). Thanks for your help!

    – Gatschet
    Nov 28 '18 at 7:34



















I am using Safari. See your example here: stackblitz.com/edit/angular-m5f2wl

– Maihan Nijat
Nov 27 '18 at 13:37





I am using Safari. See your example here: stackblitz.com/edit/angular-m5f2wl

– Maihan Nijat
Nov 27 '18 at 13:37













I see your stackbitz example is working. In my project, as soon i have any animations, Safari is broken. With all other browsers there are no such problems...

– Gatschet
Nov 27 '18 at 14:56





I see your stackbitz example is working. In my project, as soon i have any animations, Safari is broken. With all other browsers there are no such problems...

– Gatschet
Nov 27 '18 at 14:56













@MaihanNijat I also use css-grid in my project. As soon i delete display: grid it's working too... I need to verification, what's wrong...

– Gatschet
Nov 27 '18 at 15:53





@MaihanNijat I also use css-grid in my project. As soon i delete display: grid it's working too... I need to verification, what's wrong...

– Gatschet
Nov 27 '18 at 15:53













Upload to stackblitz so I have a look.

– Maihan Nijat
Nov 27 '18 at 16:03





Upload to stackblitz so I have a look.

– Maihan Nijat
Nov 27 '18 at 16:03













@MaihanNijat I updated my request with a stackblitz example which is not working when using the mat-raised-button on Safari (or any other animated material component like an input). Thanks for your help!

– Gatschet
Nov 28 '18 at 7:34







@MaihanNijat I updated my request with a stackblitz example which is not working when using the mat-raised-button on Safari (or any other animated material component like an input). Thanks for your help!

– Gatschet
Nov 28 '18 at 7:34














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53500749%2fmat-raised-button-not-working-on-safari-browser-when-using-css-grid-angular-6-w%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53500749%2fmat-raised-button-not-working-on-safari-browser-when-using-css-grid-angular-6-w%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks