summaryrefslogtreecommitdiff
path: root/internal/flamegraph/livehtml.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/flamegraph/livehtml.go')
-rw-r--r--internal/flamegraph/livehtml.go14
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();