-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16685 from ckeditor/ck/5460
Fix (ui): Block toolbar button no longer remains fixed in the same position while scrolling the editable content. Closes #5460.
- Loading branch information
Showing
6 changed files
with
351 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions
65
packages/ckeditor5-ui/tests/manual/blocktoolbar/scrollable-blocktoolbar.html
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,65 @@ | ||
|
||
<h2>Scrollable parent:</h2> | ||
|
||
<div style="max-height: 300px; max-width: 400px; overflow: auto;"> | ||
<div id="editor-scrollable-parent"> | ||
<h2>About CKEditor 5</h2> | ||
|
||
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p> | ||
|
||
<figure class="image"> | ||
<img src="./sample.jpg" alt="Autumn fields" /> | ||
</figure> | ||
|
||
<p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p> | ||
|
||
<p>We explained this design choice in <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">“CKEditor 5: The future of rich text editing“</a>:</p> | ||
|
||
<blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be developing several out-of-the-box solutions based on it, which will be available to use in many different contexts. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured applications.</p></blockquote> | ||
|
||
<h3>Notes</h3> | ||
|
||
<p><a href="https://ckeditor.com">CKEditor 5</a> is <i>under heavy development</i> and this demo is not production-ready software. For example:</p> | ||
|
||
<ul> | ||
<li><strong>Only Chrome, Opera and Safari are supported</strong>.</li> | ||
<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">“dom.select_events.enabled”</a> option.</li> | ||
<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a> is under development (content filtering is unstable).</li> | ||
</ul> | ||
|
||
<p>It has <em>bugs</em> that we are aware of — and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p> | ||
</div> | ||
</div> | ||
|
||
<br /> | ||
<br /> | ||
|
||
<h2>Scrollable editable:</h2> | ||
|
||
<div id="editor-scrollable" style="max-height: 300px; max-width: 400px; overflow-y: scroll;"> | ||
<h2>About CKEditor 5</h2> | ||
|
||
<p>This is <a href="https://ckeditor.com">CKEditor 5</a>.</p> | ||
|
||
<figure class="image"> | ||
<img src="./sample.jpg" alt="Autumn fields" /> | ||
</figure> | ||
|
||
<p>After more than 2 years of building the next generation editor from scratch and closing over 980 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p> | ||
|
||
<p>We explained this design choice in <a href="https://medium.com/content-uneditable/ckeditor-5-the-future-of-rich-text-editing-2b9300f9df2c">“CKEditor 5: The future of rich text editing“</a>:</p> | ||
|
||
<blockquote><p>(…) we are changing our approach with CKEditor 5. We will no longer have only two solutions available, instead CKEditor will be seen as a framework for editing solutions. At the same time, we will be developing several out-of-the-box solutions based on it, which will be available to use in many different contexts. It will be a real “one size fits all” approach, from little requirements, to super advanced full featured applications.</p></blockquote> | ||
|
||
<h3>Notes</h3> | ||
|
||
<p><a href="https://ckeditor.com">CKEditor 5</a> is <i>under heavy development</i> and this demo is not production-ready software. For example:</p> | ||
|
||
<ul> | ||
<li><strong>Only Chrome, Opera and Safari are supported</strong>.</li> | ||
<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">“dom.select_events.enabled”</a> option.</li> | ||
<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">Support for pasting</a> is under development (content filtering is unstable).</li> | ||
</ul> | ||
|
||
<p>It has <em>bugs</em> that we are aware of — and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p> | ||
</div> |
39 changes: 39 additions & 0 deletions
39
packages/ckeditor5-ui/tests/manual/blocktoolbar/scrollable-blocktoolbar.js
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,39 @@ | ||
/** | ||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* globals window, document, console:false */ | ||
|
||
import BalloonEditor from '@ckeditor/ckeditor5-editor-balloon/src/ballooneditor.js'; | ||
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js'; | ||
import List from '@ckeditor/ckeditor5-list/src/list.js'; | ||
import Image from '@ckeditor/ckeditor5-image/src/image.js'; | ||
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption.js'; | ||
import { Paragraph, ParagraphButtonUI } from '@ckeditor/ckeditor5-paragraph'; | ||
import Heading from '@ckeditor/ckeditor5-heading/src/heading.js'; | ||
import HeadingButtonsUI from '@ckeditor/ckeditor5-heading/src/headingbuttonsui.js'; | ||
import BlockToolbar from '../../../src/toolbar/block/blocktoolbar.js'; | ||
|
||
createBlockButtonEditor( '#editor-scrollable-parent' ).then( editor => { | ||
window.editor = editor; | ||
} ); | ||
|
||
createBlockButtonEditor( '#editor-scrollable' ).then( editor => { | ||
window.editor2 = editor; | ||
} ); | ||
|
||
function createBlockButtonEditor( element ) { | ||
return BalloonEditor | ||
.create( document.querySelector( element ), { | ||
plugins: [ Essentials, List, Paragraph, Heading, Image, ImageCaption, HeadingButtonsUI, ParagraphButtonUI, BlockToolbar ], | ||
blockToolbar: [ | ||
'paragraph', 'heading1', 'heading2', 'heading3', 'bulletedList', 'numberedList', 'paragraph', | ||
'heading1', 'heading2', 'heading3', 'bulletedList', 'numberedList', 'paragraph', 'heading1', 'heading2', 'heading3', | ||
'bulletedList', 'numberedList' | ||
] | ||
} ) | ||
.catch( err => { | ||
console.error( err.stack ); | ||
} ); | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/ckeditor5-ui/tests/manual/blocktoolbar/scrollable-blocktoolbar.md
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,3 @@ | ||
# Scrollable block toolbar | ||
|
||
The manual test that allows testing various block toolbar behavior within scrollable containers. |
Oops, something went wrong.