Below is a fragment of a PR with changes to the keyboard shortcut hints panel. After the update, the component started behaving unstably: when reopened and when input data changes, the hints and keyboard behavior sometimes diverge from the expected ones.
props:
open: boolean — whether the panel is open or closed;scope: 'editor' | 'calendar' — the active section of the application;onClose: () => void — closes the panel.scope.Escape key must close the panel only while it is open.open=true and scope="editor".Escape — the panel closes.Escape.open=true, then change scope from editor to calendar without unmounting.scope change, the panel shows the current hints for the active section.Escape press while visible results in one close action.3.5.135.8.3<script setup lang="ts">onClose function and may change open and scope without unmounting the componentUse line comments to explain the problem, its impact, the fix and how to test it.