-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
marks on double click selection using firefox fix (#5580)
* fixed: marks on double click selection using firefox * adding changeset * minor -> patch * removing useless platform check * yarn fix * Add test --------- Co-authored-by: Joe Anderson <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'slate': patch | ||
--- | ||
|
||
Fix firefox double-click marks issue |
This file contains 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
28 changes: 28 additions & 0 deletions
28
packages/slate/test/interfaces/Editor/marks/firefox-double-click.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** @jsx jsx */ | ||
import { Editor } from 'slate' | ||
import { jsx } from '../../..' | ||
|
||
/** | ||
* This test verifies that when double clicking a marked word in Firefox, | ||
* Editor.marks for the resulting selection includes the marked word. Double | ||
* clicking a marked word in Firefox results in a selection that starts at the | ||
* end of the previous text node and ends at the end of the marked text node. | ||
*/ | ||
|
||
export const input = ( | ||
<editor> | ||
<block> | ||
plain <anchor /> | ||
<text bold> | ||
bold | ||
<focus /> | ||
</text> | ||
<text> plain</text> | ||
</block> | ||
<block>block two</block> | ||
</editor> | ||
) | ||
export const test = editor => { | ||
return Editor.marks(editor) | ||
} | ||
export const output = { bold: true } |