AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

Fix: Prevent Middle Mouse Paste (#7035)

Open Naresh-official opened this issue 9 months ago • 2 comments

Fixes #7035

Description

This PR fixes an issue where releasing the middle mouse button after panning on Linux causes an unintended paste action due to the system's primary clipboard behavior.

Changes Made

  • Updated isMiddleButtonPressed function in blocksuite/affine/shared/src/utils/event.ts to properly detect middle-click for panning vs. pasting.
  • Prevented pasting behavior if the middle mouse button was used for panning first.
  • Added a check to differentiate between intentional pasting vs. panning release.
  • Ensured compatibility across different platforms (Linux, Windows, macOS).

Naresh-official avatar Mar 17 '25 14:03 Naresh-official

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 17 '25 14:03 CLAassistant

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

graphite-app[bot] avatar Mar 17 '25 14:03 graphite-app[bot]

I think this PR can be safely closed and in favor of https://github.com/toeverything/AFFiNE/pull/11496? btw I searched for isMiddleButtonPressed and it seems it is not being used anywhere at all.

pengx17 avatar Apr 07 '25 08:04 pengx17