fix: Improve workspace comment keyboard navigation behavior. (#9211)

* fix: Prevent tabbing into workspace comments.

* fix: Focus workspace comments when navigating to them using the keyboard.
This commit is contained in:
Aaron Dodson
2025-07-07 15:28:54 -07:00
committed by GitHub
parent dfd565957b
commit e3d17becbd
2 changed files with 3 additions and 0 deletions

View File

@@ -52,6 +52,7 @@ export class CommentEditor implements IFocusableNode {
dom.HTML_NS,
'textarea',
) as HTMLTextAreaElement;
this.textArea.setAttribute('tabindex', '-1');
dom.addClass(this.textArea, 'blocklyCommentText');
dom.addClass(this.textArea, 'blocklyTextarea');
dom.addClass(this.textArea, 'blocklyText');

View File

@@ -401,6 +401,8 @@ export class LineCursor extends Marker {
block.workspace.scrollBoundsIntoView(
block.getBoundingRectangleWithoutChildren(),
);
} else if (newNode instanceof RenderedWorkspaceComment) {
newNode.workspace.scrollBoundsIntoView(newNode.getBoundingRectangle());
}
}