Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ionFocus event in ion-select is fired when the popover disappears #29904

Closed
3 tasks done
Marius-Romanus opened this issue Sep 27, 2024 · 2 comments
Closed
3 tasks done
Labels

Comments

@Marius-Romanus
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

The ionFocus event in ion-select is fired when the popover disappears.

https://ionicframework.com/docs/api/select#events

PS: I discovered this while trying to manually fix this issue... -> #19296

Expected Behavior

It should only be triggered on focus.

Steps to Reproduce

https://stackblitz.com/edit/angular-gmxghz?file=src%2Fapp%2Fexample.component.html,src%2Fapp%2Fexample.component.ts

Code Reproduction URL

https://stackblitz.com/edit/angular-gmxghz?file=src%2Fapp%2Fexample.component.html,src%2Fapp%2Fexample.component.ts

Ionic Info

Ionic:

   Ionic CLI                     : 7.2.0 
   Ionic Framework               : @ionic/angular 8.3.0
   @angular-devkit/build-angular : 18.2.4
   @angular-devkit/schematics    : 18.2.4
   @angular/cli                  : 18.2.4
   @ionic/angular-toolkit        : 12.1.1

Capacitor:

   Capacitor CLI      : 6.1.2
   @capacitor/android : not installed
   @capacitor/core    : 6.1.2
   @capacitor/ios     : not installed

Utility:

   cordova-res : not installed globally
   native-run  : 2.0.1

System:

   NodeJS : v20.16.0 (C:\Program Files\nodejs\node.exe)
   npm    : 10.8.1
   OS     : Windows 10

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Sep 27, 2024
@tanner-reits
Copy link
Contributor

@Marius-Romanus This is expected behavior (source code). When the overlay is active, we create a focus trap in the overlay to prevent focusing elements behind the popover, so when the popover closes, we need to re-focus the select since that was the last focused element before the popover was opened.

@tanner-reits tanner-reits closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2024
Copy link

ionitron-bot bot commented Dec 5, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants