Completed
Last Updated: 26 Nov 2024 12:46 by ADMIN
Release 2025 Q1 (Feb)
Alexander
Created on: 02 Sep 2024 09:42
Category: Window
Type: Bug Report
2
Window loses focus on the initial 'Shift + Tab' press when the window is first opened

Pressing Shift+Tab initially when the Window is opened, moves the focus from the Window back to the Button that opens it.

Steps To Reproduce:

  1. Open REPL repro
  2. Click "Open Modal" Button
  3. Press "Shift+Tab"
2 comments
ADMIN
Hristian Stefanov
Posted on: 02 Sep 2024 14:56

Hi Alexander,

Thank you for sharing your workaround. This will be valuable for other developers encountering the same scenario.

Regards,
Hristian Stefanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Alexander
Posted on: 02 Sep 2024 09:54

For anybody also encountering this, here is our workaround:

 

   document.addEventListener("keydown", (event) => {
      if (!event.shiftKey || event.key !== "Tab") {
         return;
      }
      if (!(event.target instanceof HTMLElement)) {
         return;
      }
      if (!event.target.classList.contains("k-window")) {
         // only prevent "Shift+Tab" on the Telerik window itself
         return;
      }
      const modal = event.target.ariaModal === "true";
      if (modal) {
         // only prevent "Shift+Tab" on modal windows
         event.preventDefault();
      }
   });