From 48b5523d954c4464f1803eb86bdb0059d5af5363 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Mon, 25 May 2026 01:55:23 +0200 Subject: [PATCH] style: format segment editor --- static/player/skip/editor.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/static/player/skip/editor.ts b/static/player/skip/editor.ts index 40fb636..6b262ed 100644 --- a/static/player/skip/editor.ts +++ b/static/player/skip/editor.ts @@ -57,7 +57,8 @@ export const setupSegmentEditor = (): void => { }; const open = (): void => { - lastActiveElement = document.activeElement instanceof HTMLElement ? document.activeElement : null; + lastActiveElement = + document.activeElement instanceof HTMLElement ? document.activeElement : null; panel.classList.remove('hidden'); panel.classList.add('flex'); panel.setAttribute('aria-hidden', 'false'); @@ -89,8 +90,10 @@ export const setupSegmentEditor = (): void => { } if (e.key !== 'Tab') return; - const focusables = Array.from(panel.querySelectorAll(focusableSelector)) - .filter(el => el instanceof HTMLElement && !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden')) as HTMLElement[]; + const focusables = Array.from(panel.querySelectorAll(focusableSelector)).filter( + el => + el instanceof HTMLElement && !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden') + ) as HTMLElement[]; if (focusables.length === 0) return; const first = focusables[0]; @@ -115,7 +118,10 @@ export const setupSegmentEditor = (): void => { if (panel.classList.contains('hidden')) return; const target = e.target as Node | null; if (!target) return; - if ((e.target as HTMLElement | null)?.closest('[data-segment-editor] [data-segment-editor-close]')) return; + if ( + (e.target as HTMLElement | null)?.closest('[data-segment-editor] [data-segment-editor-close]') + ) + return; const content = panel.firstElementChild; if (content && content.contains(target)) return; close();