Copilot commented on code in PR #8839:
URL: https://github.com/apache/texera/pull/8839#discussion_r4309362343


##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -563,6 +563,23 @@ export class WorkflowFormComponent implements OnInit, 
OnDestroy {
    */
   @HostListener("focusout")
   public onFocusOut(): void {
+    this.flushHeldRebuild();
+  }
+
+  /**
+   * A click or a key inside the page also ends a hold, because a focus change 
is not the only thing
+   * that does: closing an nz-select leaves the focus in its search box 
(ng-zorro re-focuses it), so
+   * no focusout fires, and a rebuild held while the list was open would have 
waited for an unrelated
+   * event (Copilot on #8839). The same later() re-check as below decides it 
after the current tick,
+   * by when the dropdown has lost its open class.
+   */
+  @HostListener("click")

Review Comment:
   nz-select options render in CDK's body-level overlay, outside this 
component's host, so clicking an option does not reach this listener. If a 
rebuild is held and the reader clicks the already-selected option to close the 
list, there is no value change, focusout, or keyup to release it, leaving the 
card stale. Listen for document clicks while keeping the deferred typing 
re-check, and add a regression test using an overlay option rather than 
dispatching a click directly on the host.



-- 
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]

Reply via email to