Add test to BlockNote PR #2677#2
Closed
matthewlipski wants to merge 8 commits into
Closed
Conversation
…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
* 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' }).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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