ionic-team / ionic-team/ionic-framework
bug: firefox, focus event does not fire when delegating focus
- Langage dominant
- TypeScript
- Étoiles
- 52.7k
- Forks
- 13.3k
- Merge moyen
- 1 j 15 h
- PR mergées (30 j)
- 51
Description
### Prerequisites
- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.
### Ionic Framework Version
- [ ] v4.x
- [ ] v5.x
- [X] v6.x
### Current Behavior
When the user clicks on an `` the focus is delegated to the first focusable element, in my case an ``. In this matter I was expecting the `` 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 `` the focus should get delegated to the ``, 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
```
Ionic:
Ionic CLI : 6.16.3 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.0.14
@angular-devkit/build-angular : 13.3.1
@angular-devkit/schematics : 13.3.1
@angular/cli : 13.3.1
@ionic/angular-toolkit : 6.1.0
Capacitor:
Capacitor CLI : 3.4.3
@capacitor/android : 3.4.3
@capacitor/core : 3.4.3
@capacitor/ios : 3.4.3
Utility:
cordova-res : not installed globally
native-run : 1.5.0
System:
NodeJS : v14.17.6 (/Users/felixgeissler/.nvm/versions/node/v14.17.6/bin/node)
npm : 6.14.15
OS : macOS Monterey
```
### Additional Information
In my case, this is a real show stopper since I'm trying to use my `` as a focus trigger to open an `` 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 ``.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Start with the linked StackBlitz reproduction and inspect how ion-item delegates focus to ion-input in Firefox. Verify whether the delegated element emits the native focus and ionFocus events, then confirm the fix against the reproduction and expected focus behavior.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100