Open felixgeissler opened 2 years ago
Thanks for the issue. What browser are you testing this in? I am testing this in Chrome and Safari. In both cases the ionFocus
event is firing.
Thanks for the issue. What browser are you testing this in? I am testing this in Chrome and Safari. In both cases the
ionFocus
event is firing.
I'm using Firefox Developer Edition (version 99.0b8 (64-Bit). I can indeed verify, that it works in Chrome and Safari.
Thanks! This looks like a Firefox bug. I will look into reporting this to the Firefox team.
Thanks, Liam!
Quick update: In Ionic 8 ion-item
will no longer delegate focus, so this bug should not reproduce anymore. I am going to keep this issue open because we still delegate focus with accordions, so the bug will continue to reproduce there.
Prerequisites
Ionic Framework Version
Current Behavior
When the user clicks on an
<ion-item>
the focus is delegated to the first focusable element, in my case an<ion-input>
. In this matter I was expecting the<ion-input>
to fire with it's respective(ionFocus)
event, which is unfortunatley not the case. I also tried to add a native(focus)
event listener, which also does not seem to get triggered.Expected Behavior
When the user clicks on an
<ion-item>
the focus should get delegated to the<ion-input>
, which should then fire an(ionFocus)
event.Steps to Reproduce
See Stackblitz minimal reproduction code below.
Code Reproduction URL
https://stackblitz.com/edit/ionic6-angular13-gqcrhl?file=src/app/app.component.html
Ionic Info
Additional Information
In my case, this is a real show stopper since I'm trying to use my
<ion-input>
as a focus trigger to open an<ion-datetime>
in a popover and I don't want the user to enter something in the input manually. With this approach I need a hook to open the popover once the focus is delegated to the<ion-input>
.