-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: issue with grid when grid table body is clicked and enter key is hit #2146
Conversation
cell: path[tableIndex - 3] | ||
rowGroup: tableIndex >= 3 ? path[tableIndex - 1] : null, | ||
row: tableIndex >= 3 ? path[tableIndex - 2] : null, | ||
cell: tableIndex >= 3 ? path[tableIndex - 3] : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tableIndex >= 3
is repeated 3 times. Could improve this by extracting it into a variable which would also make the code more readable, because the name of the variable indicates why in this case there is no cell/row/rowGroup.
…a general _getGridLocation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
… hit (#2146) * fix: it should not throw error when grid table body has focus and enter key is hit * extract comparison into a separate variable * Refactor to merge _parseEventPath and _getGridCellFocusLocation into a general _getGridLocation Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
… hit (#2146) (#2155) * fix: it should not throw error when grid table body has focus and enter key is hit * extract comparison into a separate variable * Refactor to merge _parseEventPath and _getGridCellFocusLocation into a general _getGridLocation Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com> Co-authored-by: Hadi Amiri <84700249+hadivaadin@users.noreply.github.com> Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
This PR solves the issue with the grid when the table body of the grid is clicked and enter key is hit, the error shows when no row of the table is selected, Or as in the mentioned in the issue when a row is clicked and empty area of the table is selected and enter key is hit.
Fixes: vaadin/flow-components#1011
Type of change
Checklist