Search code examples
ionic-frameworkionic4web-component

Adding webkit-backface-visibility to ion-button in Ionic 4


I need to add -webkit-backface-visibility: hidden to the .button-native inside ion-button because it causes flicker some times on iOS devices, I wonder how can this be done, it can't be applied through the opened shadow-dom !


Solution

  • You are right that you cannot mess with this insides, so it's not possible out of the box. This is one of the drawbacks of the Ionic 4 way of doing things.

    If it is a bug then you should open an issue on the GitHub repo.

    If it is just something specific to you then I guess your options are:

    1. Extract the ion-button out into your own project, or
    2. Do your own custom build of Ionic