Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions panel/src/components/Forms/Writer/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,6 @@ export default {
// Get sizes for the toolbar itself but also the editor box
const toolbar = this.$el.getBoundingClientRect();
const editor = this.editor.element.getBoundingClientRect();
const menu = document
.querySelector(".k-panel-menu")
.getBoundingClientRect();

// Create pseudo rectangle for the selection
const { from, to } = this.editor.selection;
Expand All @@ -401,9 +398,13 @@ export default {
}
} else {
// Contain in viewport
const menu = document
.querySelector(".k-panel-menu")
?.getBoundingClientRect();

const left = editor.x + x;
const right = left + toolbar.width;
const safeSpaceLeft = menu.width + 20;
const safeSpaceLeft = menu?.width + 20;
const safeSpaceRight = 20;

if (left < safeSpaceLeft) {
Expand All @@ -421,8 +422,8 @@ export default {

<style>
.k-writer-input:has(
.k-toolbar:not([data-inline="true"], [data-disabled="true"])
) {
.k-toolbar:not([data-inline="true"], [data-disabled="true"])
) {
grid-template-areas: "topbar" "content";
grid-template-rows: var(--toolbar-size) 1fr;
gap: 0;
Expand Down