The PR below shows changes in a standalone Angular component for a command palette. After the update, users report that keyboard navigation became unreliable: sometimes the wrong item is confirmed, and after closing the panel the Escape key keeps affecting the page.
ArrowDown and ArrowUp cyclically changes the active item.Enter executes exactly the command that is currently visually active.Escape closes the panel only while it is open.ChangeDetectionStrategy.OnPush.ArrowDown one or more times.Enter.Close button.Escape several times after it has been closed.Escape behavior does not become stronger.Escape is no longer handled by this component.20.0.0, TypeScript 5.8.2, RxJS 7.8.1templateChangeDetectionStrategy.OnPushwindow.addEventListeneridsUse line comments to explain the problem, its impact, the fix and how to test it.