dididy commented on code in PR #5057:
URL: https://github.com/apache/zeppelin/pull/5057#discussion_r2319341188
##########
zeppelin-web-angular/src/app/pages/workspace/notebook/paragraph/paragraph.component.ts:
##########
@@ -217,7 +221,8 @@ export class NotebookParagraphComponent extends
ParagraphBase implements OnInit,
if (this.paragraph.config.editorSetting.editOnDblClick &&
this.revisionView !== true) {
this.paragraph.config.editorHide = false;
this.paragraph.config.tableHide = true;
- // TODO(hsuanxyz): focus editor
+ this.focusEditor();
+ setTimeout(() =>
this.notebookParagraphCodeEditorComponent?.setCursorPositionToEnd());
Review Comment:
3d48cfe
I didn’t know much about Angular’s lifecycle before, but after looking into
`markForCheck()`, I checked it out a bit. In the current situation, it seemed
possible to use `this.cdr.detectChanges()`, and it worked as I intended.
`this.cdr.detectChanges()` forces Angular to immediately check and update
the current component and its child views, eliminating the need to wait for the
next rendering cycle with `setTimeout()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]