Issue Bug Closed

#107980Live Search does not open via Shortcut in some situations (shortcut API not available)

Josef Glatz 11/05/25, 07:41 updated 03/31/26, 09:00

Description

Problem/Description

Opening Live Search Modal via CMD+K does not work after an info modal was opened.

  1. Open e.g. info modul (or backend user module, it is not limited to a specific backend module)
  2. Click on info of a record and a modal with info modal opens
  3. close it
  4. press CMD+k respectively STRG+k to open the beloved TYPO3 live search → results in console error

> Uncaught TypeError: CustomEvent is not a constructor

CustomEvent seems not to be overridden by custom javascript.

  • Chrome Version 142.0.7444.60 (arm64)

Affected: TYPO3 main (14.0-dev) and TYPO3 13 (maybe also older versions too)

Acceptance Criteria

  • A hotkey must work in “every” situation while a backend user has a valid user session
  • the live search must be shown if you open it via the offical hotkey cmd+k / strg+k

Reviews 3

History 713

  1. Andreas Kienast commented <span data-processor="relativetime" data-value="2025-11-05T07:59:16+00:00" > 11/05/25, 07:59 </span>

    Analysis: this issue happens once an iframe is loaded in a modal window, as live-search-shortcut.js is loaded and re-registers its shortcut. Once the modal window is closed, the referenced iframe is removed from DOM, rendering the registered shortcut useless as the bound reference is unavailable.

  2. Josef Glatz commented and changed description <span data-processor="relativetime" data-value="2025-11-05T08:08:45+00:00" > 11/05/25, 08:08 </span>

    Thanks Andi!

    For the reference, here’s a simple git diff to check it via console.log:

    diff --git a/Build/Sources/TypeScript/backend/live-search/live-search-shortcut.ts b/Build/Sources/TypeScript/backend/live-search/live-search-shortcut.ts
    index e05cf11c2e8..4634f89ed5b 100644
    --- a/Build/Sources/TypeScript/backend/live-search/live-search-shortcut.ts
    +++ b/Build/Sources/TypeScript/backend/live-search/live-search-shortcut.ts
    @@ -7,15 +7,21 @@ import DocumentService from '@typo3/core/document-service';
     class LiveSearchShortcut {
       public constructor() {
         DocumentService.ready().then((): void => {
    +      console.log('document ready');
           Hotkeys.register([Hotkeys.normalizedCtrlModifierKey, 'k'], (e: KeyboardEvent): void => {
    +        console.log(Hotkeys.normalizedCtrlModifierKey + '+k triggered');
    +
             if (Modal.currentModal) {
               // A modal window is already active, keep default behavior of browser
    +          console.log('modal is active, aborting');
               return;
             }
    
             e.preventDefault();
    
    +        console.log('Attempting to dispatch CustomEvent typo3:live-search:trigger-open');
             document.dispatchEvent(new CustomEvent('typo3:live-search:trigger-open'));
    +        console.log('Attempting to dispatch BroadcastMessage live-search:trigger-open');
             BroadcastService.post(new BroadcastMessage(
               'live-search',
               'trigger-open',
    1. Apply it (e.g. apply git diff from clipboard function in your IDE)
    2. Compile core typescript (run npm install in Build folder
  3. Josef Glatz changed subject Live Search does not open via Shortcut in some situations Live Search does not open via Shortcut in some situations (shortcut API not available) <span data-processor="relativetime" data-value="2025-11-05T09:50:36+00:00" > 11/05/25, 09:50 </span>

  4. Gerrit Code Review pushed patch set 1 for main to change 92505 status Accepted Under Review <span data-processor="relativetime" data-value="2026-01-25T16:38:44+00:00" > 01/25/26, 16:38 </span>

  5. Andreas Kienast commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-01-30T15:10:10+00:00" > 01/30/26, 15:10 </span>

    Applied in changeset commit:594b1a31e8d9afc95d9465af249386789c852bb7.