ignore key action if posthog survey is focused (#13466)

This commit is contained in:
melohagan 2024-04-11 15:25:36 +01:00 committed by GitHub
parent 8c32127a6f
commit a044ba226a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -137,8 +137,12 @@
const activeTag = document.activeElement?.tagName.toLowerCase()
const inCodeEditor =
document.activeElement?.classList?.contains("cm-content")
const inPosthogSurvey =
document.activeElement?.classList?.[0]?.startsWith("PostHogSurvey")
if (
(inCodeEditor || ["input", "textarea"].indexOf(activeTag) !== -1) &&
(inCodeEditor ||
inPosthogSurvey ||
["input", "textarea"].indexOf(activeTag) !== -1) &&
e.key !== "Escape"
) {
return