The intent is to have the ckEditor toolbar fixed at the top while being able to scroll through the content. Currently, toolbar gets scrolled off the screen as shown in the GIF image below.This component is on a page that is scrollable. So the position:fixed;
does not work as I tried that.
The label Question Stem stays at the top and is wrapped by Vuetify Toolbar component.
the ck-toolbar class on the toolbar items has the following CSS
.ck.ck-toolbar {
align-items: center;
display: flex;
flex-flow: row nowrap;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
}
I have added the following CSS to make the content scrolable.
#ckEditorQuestionStem .ck.ck-toolbar > .ck-toolbar__items {
position: relative !important;
z-index: 10;
}
#ckEditorQuestionStem .ck.ck-editor__main {
max-height: 400px;
overflow-y: auto;
position: relative !important;
}
The HTML for this is shown in the screenshot below
I tried the method posted here. Also tried adding viewportTopOffset: 50,
under toolbar of the editor config. No luck so far.
I reolved this by applying the following style on the parent element of ckEditor
style="contain: content;"
And keeping the toolbar position as fixed.
#ckEditorQuestionStem .ck.ck-toolbar > .ck-toolbar__items {
position: fixed !important;
margin-right: 5px;
margin-left: -6px;
min-height: 100px;
top: 0px;
z-index: 2;
}
Posting the answer in case someone finds it helpful. Here is the current editor window with scrollable body and fixed toolbar. This is more desirable than a sticky toolbar.
This was helpful in arriving at the solution.