We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f50a034 commit 7ffd6ceCopy full SHA for 7ffd6ce
packages/vue/src/hooks/keyboard.ts
@@ -1,5 +1,5 @@
1
import type { Ref } from "vue";
2
-import { ref } from "vue";
+import { ref, onBeforeUnmount, getCurrentInstance } from "vue";
3
4
export interface UseKeyboardResult {
5
isOpen: Ref<boolean>;
@@ -33,6 +33,12 @@ export const useKeyboard = (): UseKeyboardResult => {
33
window.addEventListener("ionKeyboardDidHide", hideCallback);
34
}
35
36
+ if (getCurrentInstance()){
37
+ onBeforeUnmount(() => {
38
+ unregister()
39
+ });
40
+ }
41
+
42
return {
43
isOpen,
44
keyboardHeight,
0 commit comments