onSelection event raises when the focus comes back to the grid again
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
- Run the attached sample
- Select a row by clicking a cell
- Hit "Alt + Tab" to switch the active window
- 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
It seems issue is reproducing not only under Mozilla, but also under Chrome. In edge clicking a cell fires the selection event twice.
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.
Resolved with PR: #2677