source dump of claude code
at main 21 lines 687 B view raw
1import { type EventTarget, TerminalEvent } from './terminal-event.js' 2 3/** 4 * Focus event for component focus changes. 5 * 6 * Dispatched when focus moves between elements. 'focus' fires on the 7 * newly focused element, 'blur' fires on the previously focused one. 8 * Both bubble, matching react-dom's use of focusin/focusout semantics 9 * so parent components can observe descendant focus changes. 10 */ 11export class FocusEvent extends TerminalEvent { 12 readonly relatedTarget: EventTarget | null 13 14 constructor( 15 type: 'focus' | 'blur', 16 relatedTarget: EventTarget | null = null, 17 ) { 18 super(type, { bubbles: true, cancelable: false }) 19 this.relatedTarget = relatedTarget 20 } 21}