Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable header row marker on single selection #935

Merged
merged 5 commits into from
May 10, 2024

Conversation

lukasmasuch
Copy link
Collaborator

@lukasmasuch lukasmasuch commented Apr 3, 2024

Configuring rowSelect as single still shows a not-functional checkbox in the row marker header. I would expect that this isn't shown since this feature doesn't really make sense for single-row selection. This PR disables the row marker header for rowSelect == single.

Screen.Recording.2024-04-02.at.22.21.52.mov

Closes #934

In addition, in the current impl. it was also possible to have multi-selection even if row select is set to single. For example, touch devices would falsely allow multi-selection. This PR also enforces the single configuration.

@@ -1795,7 +1798,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction<DataEditorRef, DataEditorPr
} else {
setSelectedRows(CompactSelection.fromSingleSelection(newSlice), undefined, isMultiRow);
}
} else if (isMultiRow || args.isTouch || rowSelectionMode === "multi") {
} else if (rowSelect === "multi" && (isMultiRow || args.isTouch || rowSelectionMode === "multi")) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

An additional check for rowSelect == multi here to make sure that multi-selection is only allowed if it is actually configured.

@jassmith jassmith merged commit c21e6ca into main May 10, 2024
7 checks passed
@jassmith jassmith deleted the fix/header-row-marker-for-single-selection branch May 10, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Row marker header checkbox is incorrectly shown for single row selection
2 participants