ionFocus or ionBlur not working in ios but working in browser

I m using ionic angular, I have added HostListener(‘ionFocus’), and it is working in the browser without any issue. But when I build an app on ios for iPhone, it stops working. only HostListener(‘click’) is working

Can u post some code?

And if you bind with (ionFocus) on the element, does it work?

In html template: you can see customDirective appFocusBlurListener



add Category

Custom Directive:

import { Directive, HostListener, Renderer2 } from ‘@angular/core’;

@Directive({
selector: ‘[appFocusBlurListener]’,
})
export class FocusBlurListenerDirective {
constructor(private renderer: Renderer2) {}

@HostListener(‘click’, [’$event.target’])
onClick(element): void {
console.log(’---- click’);
}

@HostListener(‘ionFocus’, [’$event.target’])
onFocus(element): void {
console.log(’---- focussss’);
this.renderer.addClass(element, ‘ion-focused’);
this.renderer.addClass(element, ‘ion-activated’);
}
@HostListener(‘focus’, [’$event.target’])
onFocus2(element): void {
console.log(’---- focussss2’);
this.renderer.addClass(element, ‘ion-focused’);
this.renderer.addClass(element, ‘ion-activated’);
}
}
I only want to list ionFocus, but for testing purpose added click, focus listener as well.
In the browser, all three listeners working properly.

but when I build an ios app. and run app on iphone, only click listener working not other ones.

Back Story: actually in iphone,whenever I press button, before releasing the press from button (press/focus mode), button background color changed. I tried different ways to override the behavior through css but not working. After r & d found that when we press the button, ionic put two classes on that button, ion-focused / ion-activated. but due to some reason this cases are not adding in iphone app. I tried to put these cases manually in class attribute of button, and then build an app on ios. press button background color change according to my requirement.
So that why i m trying to put ionFocus to put manually these classes on pressing the button