Since #12241 we have notifications for this when the user navigates away from the viewer, but we do not yet warn when switching documents, which means that if you call e.g. `PDFViewerApplication.open` with a new document (or directly call `BaseViewer.setDocument` when using the viewer components standalone) there won't be any warning about losing form data. This should be addressed.
PDFViewerApplication.appConfig.toolbar.pageNumber.select();
        handled = true;
        break;
    }
  }
  if (handled) {
    if (ensureViewerFocused && !isViewerInPresentationMode) {
      pdfViewer.focus();
    }
    evt.preventDefault();
    return;
  }
  
  
  const curElement = getActiveOrFocusedElement();
  const curElementTagName = curElement?.tagName.toUpperCase();
  if (
    curElementTagName === "INPUT" ||
    curElementTagName === "TEXTAREA" ||
    curElementTagName === "SELECT" ||
    curElement?.isContentEditable
  ) {
    
    if (evt.keyCode !==  27) {
      return;
    }
  }
  
  if (cmd === 0) {