Skip to content

Conversation

@valadzhov
Copy link
Collaborator

Closes #16664

Only a programmatically closing combo should be focused. Initially it was like that but this PR forces this.comboInput.focus(); in both cases - when it's closed programmatically and due to user interaction:
#12170

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a critical performance issue (issue #16664) where repeatedly clicking between multiple igx-simple-combo components caused CPU usage to increase and eventually freeze the browser. The root cause was a focus loop introduced in PR #12170, where the combo input was always refocused when the dropdown closed, even when the close was triggered by user interaction (like clicking on another combo).

Changes:

  • Modified the dropdown.closing event handler to only call this.comboInput.focus() when the combo is closed programmatically (when !args.event), preventing focus loops when users click between multiple combos
  • Added an explanatory comment documenting why focus is only applied for programmatic closes

Comment on lines +234 to +236
// Only focus back when programmatically closing (no user event)
// to avoid focus loops when user clicks on another combo
this.comboInput.focus();
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix for the focus loop issue when alternating between multiple combos lacks test coverage. Consider adding a test that verifies:

  1. When a combo is closed programmatically (via the close() method), the input receives focus
  2. When a combo is closed due to user interaction (e.g., clicking outside or clicking another combo), the input does NOT receive focus
  3. Repeatedly clicking between two combos with selected items does not cause a focus loop

This would help prevent regressions of issue #16664.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

igx-simple-combo: Repeated Switching Between Two Combos Causes Severe Performance Issues

2 participants