diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-27 18:29:34 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-27 18:29:34 +0200 |
| commit | 1cf64c3e43b1bdc2b6443fd24db8028f3c96c6da (patch) | |
| tree | f6eae3710242affb7b60b76559fd858289b1fcbc /internal/flamegraph/livehtml.go | |
| parent | dab0a1a62e3a51cfe1c45001e10311cf369519c8 (diff) | |
flamegraph: test pause/keyboard live interactions
Diffstat (limited to 'internal/flamegraph/livehtml.go')
| -rw-r--r-- | internal/flamegraph/livehtml.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/flamegraph/livehtml.go b/internal/flamegraph/livehtml.go index b2ea36a..9531f85 100644 --- a/internal/flamegraph/livehtml.go +++ b/internal/flamegraph/livehtml.go @@ -554,7 +554,21 @@ const liveHTML = `<!doctype html> }; } + function fgIsTextEntryTarget(target) { + if (!target) { + return false; + } + if (target.isContentEditable) { + return true; + } + var tag = (target.tagName || '').toUpperCase(); + return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT'; + } + function fgHandleKeydown(ev) { + if (fgIsTextEntryTarget(ev.target)) { + return; + } if (ev.key === ' ' || ev.code === 'Space') { ev.preventDefault(); fgTogglePause(); |
