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

DataGrid selection refactoring #13848

Merged
merged 1 commit into from
Dec 7, 2023
Merged

Conversation

ltetak
Copy link
Contributor

@ltetak ltetak commented Dec 6, 2023

What does the pull request do?

This is a continuation of #13680 where handled events were ignored in the DataGridCell. There is similar logic in DataGridRows that is quite convoluted and makes no sense to me. It is very old code but there are several code smells

  1. internal flag UpdatedStateOnMouseLeftButtonDown steps in for event bubbling here (instead of event Handled property this uses this property on a DataGrid level)
  2. there is always some DataGridCell or header that will handle the PointerPressed event. It handles the selection as well.

What is the updated/expected behavior with this PR?

The behavior is the same as before. The code is simpler and as with #13680 the motivation is to be able to hook to mouse clicks to update selection logic if needed.

Breaking changes

I don't know about any but if there is any case where the user can click on a row but not on a cell then this is wrong.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0042690-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Dec 7, 2023
Merged via the queue into AvaloniaUI:master with commit 9654471 Dec 7, 2023
6 checks passed
@ltetak
Copy link
Contributor Author

ltetak commented Mar 6, 2024

@maxkatz6 is it possible to backport this to the 11.0 branch? We would like to use the stable branch in our app, thanks!

@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Mar 7, 2024
maxkatz6 pushed a commit that referenced this pull request Apr 6, 2024
@maxkatz6 maxkatz6 removed the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Jun 11, 2024
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.

3 participants