Ionic version:
[x] 4.0.0
Describe the Feature Request
I would love to see disabled attribute for back button (sometimes we need to block actions for example when we wait for response - would be cool to block it). For now i just use hidden attribute but it looks weird when it disappears unexpectedly.
I need to translate "Back" text for ios. On android defaultly there is just an arrow (without text). But when i use attribute text it shows also text on android which I don't need.

Describe Preferred Solution
[iosText]="'Back' | translate"
Have a nice day 馃榾
Meanwhile to hide the text in android you can use in variables.scss
.button-text.sc-ion-back-button-md {
display: none;
}
@christianguevara that's a clever workaround 馃槀
1) A disabled attribute actually already exists for the back button component, but it doesn't look like it's exposed to Angular.
You can use it like this:
<ion-back-button [disabled]="true"></ion-back-button>
2) Regarding the back button text, you could do this in AppComponent's ' ngOnInit (which is also more DRY than defining the button text everywhere) :
if (this.platform.is('ios')) {
this.translateService.onLangChange.subscribe((event: LangChangeEvent) => {
this.config.set('backButtonText', this.translateService.instant('Back'));
});
}
@biesbjerg - thanks a lot! 馃殌
this.config.set is deprecated and that's why there should still be an option to translate the back button text globally in a simple way.
@christianguevara thank's for your solution!
I'm using Ionic 5 and it doesn't work anymore because they moved more components over to shadow dom. Does anyone have an updated solution for the problem that the text should only be shown when running on iOS?
@christianguevara thank's for your solution!
I'm using Ionic 5 and it doesn't work anymore because they moved more components over to shadow dom. Does anyone have an updated solution for the problem that the text should only be shown when running on iOS?
In my case the problem doesn't exist as long as I'm using .config (provided by @biesbjerg) to set up the text instead of text="xyz". @NiklasMerz said it's deprecated but it works.
Most helpful comment
this.config.setis deprecated and that's why there should still be an option to translate the back button text globally in a simple way.