Skip to content

Commit a080c0d

Browse files
committed
Derive initial expanded state for newly mounted thread
1 parent 97f19c8 commit a080c0d

File tree

1 file changed

+6
-1
lines changed
  • packages/editor/src/components/collab-sidebar

1 file changed

+6
-1
lines changed

packages/editor/src/components/collab-sidebar/comments.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function Thread( {
107107
setShowCommentBoard,
108108
commentSidebarRef,
109109
} ) {
110-
const [ isExpanded, setExpanded ] = useState( false );
110+
const [ isExpanded, setExpanded ] = useState( isSelected );
111111
const { toggleBlockHighlight, selectBlock } =
112112
useDispatch( blockEditorStore );
113113
const relatedBlockElement = useBlockElement( thread.blockClientId );
@@ -393,6 +393,11 @@ const CommentBoard = ( { thread, onEdit, onDelete, status } ) => {
393393
/>
394394
<FlexItem
395395
className="editor-collab-sidebar-panel__comment-status"
396+
onMouseDown={ ( event ) => {
397+
// Prevent the thread from being selected.
398+
event.preventDefault();
399+
// event.stopPropagation();
400+
} }
396401
onClick={ ( event ) => {
397402
// Prevent the thread from being selected.
398403
event.stopPropagation();

0 commit comments

Comments
 (0)