igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

onSelection event raises when the focus comes back to the grid again

Open ymita opened this issue 8 years ago • 3 comments

Description

onSelection event raises when the focus comes back to the grid again.

  • igniteui-angular version: 6.1.2
  • browser: Chrome 68.0.3440.75, Firefox 61.0.1, Edge 42.17134.1.0

Steps to reproduce

  1. Run the attached sample
  2. Select a row by clicking a cell
  3. Hit "Alt + Tab" to switch the active window
  4. Hit "Alt + Tab" again to switch back to the window

Note: keep the mouse position on igx-grid while operating the step 3 to 4.

Result

onSelection event raises even selection is not changed.

Expected result

onSelection event does not raise as selection is not changed.

Attachments

grid1.zip

ymita avatar Jul 31 '18 07:07 ymita

It seems issue is reproducing not only under Mozilla, but also under Chrome. In edge clicking a cell fires the selection event twice.

hanastasov avatar Aug 07 '18 15:08 hanastasov

Changing the active window throws the focus event for any element, it seems this is how browsers handle it. Furtheremore, selection is being refactored now so that it happens on "keydown" and on "click" events, rather than on focus, which will resolve the issue for the igxGrid. I will put a link to the PR that resolves that here.

hanastasov avatar Aug 08 '18 07:08 hanastasov

Resolved with PR: #2677

nrobakova avatar Oct 22 '18 05:10 nrobakova