Skip to content

Add test to BlockNote PR #2677#2

Closed
matthewlipski wants to merge 8 commits into
opf:mainfrom
TypeCellOS:shadow-copy-test
Closed

Add test to BlockNote PR #2677#2
matthewlipski wants to merge 8 commits into
opf:mainfrom
TypeCellOS:shadow-copy-test

Conversation

@matthewlipski
Copy link
Copy Markdown

@matthewlipski matthewlipski commented Apr 29, 2026

This PR adds an e2e test for copying content in a non-editable block and pasting it in the editor, to ensure there are no regressions. A playground example is also added for this test.

TypeCellOS#2677

matthewlipski and others added 5 commits April 28, 2026 15:45
…2680)

* Added dark mode styling for file block wrapper component

* Updated e2e screenshots
…ction (BLO-1007) (#2683)

* Made side menu delete button delete other blocks spanned by selection

* Added e2e tests

* Reverted `package.json`
* Made Enter move selection to cell below in tables

* Implemented PR feedback
@matthewlipski matthewlipski changed the title Add test to #2677 Add test to BlockNote PR #2677 Apr 29, 2026
matthewlipski and others added 3 commits April 29, 2026 17:41
* Changed "Default" color name to "Auto"

* Fixed block color CSS issues

* Fixed rendering issues
…ibility (#2677)

OpenProject embeds BlockNote inside a Shadow DOM (attachShadow({ mode: 'open' }))
to isolate it from the host Angular application. In this setup,
window.getSelection() returns null or a collapsed selection even when text is
selected (Firefox all versions, Safari ≤16.3, Chromium edge cases), causing
checkIfSelectionInNonEditableBlock to always return true and skip the
clipboard write entirely. The browser's default copy then fires, which uses
ProseMirror's DOMSerializer without semantic wrappers — so list formatting,
headings, and bold/italic are lost on paste into external apps.

Fix: use view.state.selection.empty as the primary empty-selection guard.
ProseMirror's internal state is always accurate regardless of DOM mode. The
DOM-level non-editable-island check is kept as a secondary guard, but only
when window.getSelection() actually returns a non-collapsed selection.

Fixes copy/cut for editors mounted inside attachShadow({ mode: 'open' }).
@matthewlipski matthewlipski deleted the shadow-copy-test branch April 29, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants