Skip to content

fix: dont activate base delete areas for keyboard moves#9748

Merged
maribethb merged 2 commits intoRaspberryPiFoundation:v13from
maribethb:delete-areas
Apr 22, 2026
Merged

fix: dont activate base delete areas for keyboard moves#9748
maribethb merged 2 commits intoRaspberryPiFoundation:v13from
maribethb:delete-areas

Conversation

@maribethb
Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9721

Proposed Changes

  • updates the default delete area implementation to not delete things if a keyboard move is in progress
  • removes the toolbox's override of wouldDelete since it was not different than the base implementation (please double check me on that)
  • updates the toolbox and trashcan various onDragEnter/Exit/etc to not fire if it's a keyboard drag

Reason for Changes

The reason I chose this approach is it updates the default delete area to not trigger for keyboard moves, but allows developers to customize it if they do want their delete areas to trigger for keyboard moves

An alternative was to have the dragger just not fire any of the drag target methods if the drag target was also a delete area. but that was actually more complicated due to various factors (e.g. if you are moving from a regular drag target to a delete area, you have to make sure to trigger the onDragExit for the regular drag target but NOT trigger the onDragEnter for the delete area). And it's less customizable and explainable for developers implementing their own drag targets.

Test Coverage

i will add a test case for this before i merge this but wanted to get review on the approach first because i have another commitment today before i can write the test

Documentation

we don't have any documentation for delete areas but if we did we should tell developers they should probably not activate them for keyboard moves

Additional Information

@maribethb maribethb requested a review from a team as a code owner April 22, 2026 17:55
@maribethb maribethb requested a review from gonfunko April 22, 2026 17:55
@github-actions github-actions Bot added the PR: fix Fixes a bug label Apr 22, 2026
@maribethb
Copy link
Copy Markdown
Contributor Author

added tests

@maribethb maribethb merged commit 10739f9 into RaspberryPiFoundation:v13 Apr 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants