Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
REmove escHandler on unmount BBAlert/BBModal
Tianzhou Chen869770c9c704
diff --git a/frontend/src/bbkit/BBAlert.vue b/frontend/src/bbkit/BBAlert.vueindex 783d3e00f9..08db0bd713 100644--- a/frontend/src/bbkit/BBAlert.vue+++ b/frontend/src/bbkit/BBAlert.vue@@ -160,7 +160,7 @@</template><script lang="ts">-import { onMounted, PropType } from "vue";+import { onMounted, onUnmounted, PropType } from "vue";export default {name: "BBAlert",@@ -206,12 +206,18 @@ export default {}};+ const escHandler = (e: KeyboardEvent) => {+ if (e.code == "Escape") {+ cancel();+ }+ };+onMounted(() => {- document.addEventListener("keydown", (e: KeyboardEvent) => {- if (e.code == "Escape") {- cancel();- }- });+ document.addEventListener("keydown", escHandler);+ });++ onUnmounted(() => {+ document.removeEventListener("keydown", escHandler);});const buttonStyleMap: Record<string, string> = {diff --git a/frontend/src/bbkit/BBModal.vue b/frontend/src/bbkit/BBModal.vueindex d381e11c93..3059f1aaa4 100644--- a/frontend/src/bbkit/BBModal.vue+++ b/frontend/src/bbkit/BBModal.vue@@ -47,7 +47,7 @@</template><script lang="ts">-import { onMounted } from "vue";+import { onMounted, onUnmounted } from "vue";export default {name: "BBModal",@@ -76,12 +76,18 @@ export default {}};+ const escHandler = (e: KeyboardEvent) => {+ if (e.code == "Escape") {+ close();+ }+ };+onMounted(() => {- document.addEventListener("keydown", (e: KeyboardEvent) => {- if (e.code == "Escape") {- close();- }- });+ document.addEventListener("keydown", escHandler);+ });++ onUnmounted(() => {+ document.removeEventListener("keydown", escHandler);});return {