diff --git a/packages/superdoc/src/SuperDoc.vue b/packages/superdoc/src/SuperDoc.vue index 1cdf802681..b3e693953d 100644 --- a/packages/superdoc/src/SuperDoc.vue +++ b/packages/superdoc/src/SuperDoc.vue @@ -589,7 +589,7 @@ watch(getFloatingComments, () => { v-click-outside="cancelPendingComment" /> -
+
{ display: flex; } +.right-sidebar { + min-width: 320px; +} + .floating-comments { min-width: 300px; + width: 300px; } .superdoc--with-sidebar { /* */ } diff --git a/packages/superdoc/src/helpers/use-selection.js b/packages/superdoc/src/helpers/use-selection.js index 8109c7ff96..3092064846 100644 --- a/packages/superdoc/src/helpers/use-selection.js +++ b/packages/superdoc/src/helpers/use-selection.js @@ -3,7 +3,7 @@ import { ref, reactive, toRaw } from 'vue'; export default function useSelection(params) { const documentId = ref(params.documentId); const page = ref(params.page); - const selectionBounds = reactive(params.selectionBounds); + const selectionBounds = reactive(params.selectionBounds || {}); const source = ref(params.source); /* Get the ID of the container */ diff --git a/packages/superdoc/src/stores/comments-store.js b/packages/superdoc/src/stores/comments-store.js index bc0f82e223..aa0ce2aaa5 100644 --- a/packages/superdoc/src/stores/comments-store.js +++ b/packages/superdoc/src/stores/comments-store.js @@ -358,6 +358,7 @@ export const useCommentsStore = defineStore('comments', () => { const newComment = useComment(comment.getValues()); if (pendingComment.value) newComment.setText({ text: currentCommentText.value, suppressUpdate: true }); + else newComment.setText({ text: comment.commentText, suppressUpdate: true }); newComment.selection.source = pendingComment.value?.selection?.source; // Set isInternal flag @@ -390,7 +391,6 @@ export const useCommentsStore = defineStore('comments', () => { // Emit event for end users if (__IS_DEBUG__) console.debug('[addComment] emitting...', event); superdoc.emit('comments-update', event); - }; const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => { @@ -550,8 +550,8 @@ export const useCommentsStore = defineStore('comments', () => { generalCommentIds, editorCommentIds, commentsParentElement, - hasInitializedLocations, editorCommentPositions, + hasInitializedLocations, // Floating comments floatingCommentsOffset,