Knockout-Contrib / Knockout-Contrib/KoGrid

With multiselect off, after sorting, the last selected row remains highlighted.

Open
#240 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
277
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Reproduction:

  • grid with some data, selectedItems bound (doesn't have to be), multiSelect off.
  • select a row
  • sort the grid on a different column
  • select a new row

What's expected:
Previous row is deselected, new row is now active

What's happening:
Previous row is removed from selectedItems, but remains highlighted.
New row is added to selectedItems, and highlighted as well.

I haven't been able to properly debug, but I suppose the lastClickedRow no longer refers to the visible row after sorting, since sorting sets the data context variable to the newly sorted dataset and therefor triggers a redraw?

Sander

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a grid using single selection, then trace the selection state around sorting and redraws, especially selectedItems and lastClickedRow. Verify that selecting a new row after sorting removes the previous highlight and leaves only the new row active, matching the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.