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

[Mac] Fix selection on context menu after image selection click #2423

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

ianeli1
Copy link
Member

@ianeli1 ianeli1 commented Feb 16, 2024

Fixes a bug that would cause context menu event to clear image selection on Mac, using Content Model editor.

This is due to a Mac behavior of not firing the mouseup event after/before a contextmenu event is fired and default context menu is displayed.

Given that SelectionPlugin relies on mouseUp plugin event to reselect the image in such cases, this would cause a contextMenu plugin event to be fired with no image selection available. In the case of the demo, this would result in no image context menu displayed.

Fixed by reusing previous selection if mouseDown target is a span and the first child is the previously selected image.

Additionally, allow dragged selection on right click mouseUp, since it's impossible to drag a <span> on a right click.

@ianeli1 ianeli1 merged commit 41eb153 into master Feb 20, 2024
7 checks passed
JiuqingSong pushed a commit that referenced this pull request Feb 20, 2024
* Workaround for no mouseUp event (#2423)

* bump content model to 0.26.1
JiuqingSong pushed a commit that referenced this pull request Feb 20, 2024
ianeli1 added a commit that referenced this pull request Mar 1, 2024
* fix collapsed

* remove test

* fix list

* remove margins

* Workaround for no mouseUp event (#2423)

* Rename StandaloneEditor to Editor (#2416)

* Rename StandaloneEditor to Editor

* fix build

* add parameter

* fix conflicts

* fix selection

* Fix insertNode: Do not reselect if updateCursor is false (#2431)

* Bump ip from 1.1.5 to 1.1.9 (#2433)

Bumps [ip](https://github.com/indutny/node-ip) from 1.1.5 to 1.1.9.
- [Commits](indutny/node-ip@v1.1.5...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Outdent indented empty paragraph when pressing Backspace. (#2429)

* outdent on backspace

* Remove unneeded check

* fix test build

* handle Tab key for paragraph

* fix build

* fix build

* remove /lib

* disable list features

* save last focus

* Support adding options for exportContent (#2443)

* Set RootFontSize to SanitizingContext (#2445)

* init

* fix Build

* Check once if it is Rem Unit

* refactor

* fix build

* Fix #2435 (#2442)

* format with content model

* remove empty line

* Split contentDiv into physicalRoot and logicalRoot (#2441)

* Split contentDiv into physicalRoot and logicalRoot

* Fix failing test

* Fixed failing test harnesses

* Updated in response to PR comments

* Fix tests

* add unit test

* Fix dispose plugin issus in EditorAdapter (#2452)

* Fix #2202 again (#2450)

* Improve Entity State related API (#2444)

* Improve Entity State related API

* fix build and test

* add test

---------

Co-authored-by: Bryan Valverde U <[email protected]>

* Port Table edit plugin (#2358)

* Standalone Editor step 2

* Standalone Editor step 3

* improve

* Standalone Editor step 4

* Standalone Editor: Remove compatible enums from standalone editor

* improve

* Standalone Editor: Create new event types

* Port to new event system

* Revert "Port to new event system"

This reverts commit 60cf041.

* Port to new event system

* Improve

* fix build

* fix demo

* Fix buttons

* fix build

* fix build

* fix build

* plugin added to cm demo site

* pluginUtils imported

* IStandaloneEditor changes

* editTable can skip undo snapshot

* TableEditPlugin port start

* move D&D to folder

* add plugin to Standalone demo and remove old plugin

* demo fix

* rename D&D and fix import

* demo site changes

* rename selector to mover

* new plugin utils, organisation

* isMobileOrTablet

* cleanup

* normalise width too

* remove onShowHelperElement, fix containment, instancing, others

* implement cell resizer

* fix type import

* fix selection

* fix imports

* fix instanceof, use formatTableWithContentModel, getDOMHelper

* fix merge

* small fix

* fix table resize functionality

* fix merge

* fix import

* fix dependency

* fix exports

* merge fix

* export MIN_WIDTH

* fix resizers

* add check

* fix color

* fix instanceof

* change IStandaloneEditor to IEditor

* fix export const

* rename const

* fix cell resizer, add ids

* add tests

* fix build issues

---------

Co-authored-by: Jiuqing Song <[email protected]>

* Port ShortcutPlugin (#2427)

* Port ShortcutPlugin

* fix build

* add test

* add test

* add test

* fix build

* fix build

* improve

* fix comment

* fix test

* Add option to configure the default paste type (#2457)

* init

* Add tests

* Fix build

* Bump Versions

* Remove Space

* Fix 258837 and 257626 (#2459)

* Remove Bg Color from block on Merge Paste (#2458)

* init

* Remove unneeded code

* address comment

* remove empty line

* Fix Version Numbers

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Júlia Roldi <[email protected]>
Co-authored-by: Julia Roldi <[email protected]>
Co-authored-by: Jiuqing Song <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bryan Valverde U <[email protected]>
Co-authored-by: florian-msft <[email protected]>
Co-authored-by: Andres-CT98 <[email protected]>
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.

None yet

3 participants