mirror of
https://github.com/google/blockly.git
synced 2026-01-30 12:10:12 +01:00
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:
@@ -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');
|
||||
|
||||
@@ -401,6 +401,8 @@ export class LineCursor extends Marker {
|
||||
block.workspace.scrollBoundsIntoView(
|
||||
block.getBoundingRectangleWithoutChildren(),
|
||||
);
|
||||
} else if (newNode instanceof RenderedWorkspaceComment) {
|
||||
newNode.workspace.scrollBoundsIntoView(newNode.getBoundingRectangle());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user