]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(files): Make `openMenu` watcher null safe
authorFerdinand Thiessen <opensource@fthiessen.de>
Wed, 11 Sep 2024 09:51:20 +0000 (11:51 +0200)
committerFerdinand Thiessen <opensource@fthiessen.de>
Wed, 11 Sep 2024 09:51:51 +0000 (11:51 +0200)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/files/src/components/FileEntryMixin.ts

index 7a4f4e809f7a41ba74d11c7efce73cd57a4a9789..4c88cba00b8ef566382006e8d3804560887e775a 100644 (file)
@@ -221,9 +221,11 @@ export default defineComponent({
                                                return
                                        }
                                        // Reset any right menu position potentially set
-                                       const root = this.$el?.closest('main.app-content') as HTMLElement
-                                       root.style.removeProperty('--mouse-pos-x')
-                                       root.style.removeProperty('--mouse-pos-y')
+                                       const root = document.getElementById('app-content-vue')
+                                       if (root !== null) {
+                                               root.style.removeProperty('--mouse-pos-x')
+                                               root.style.removeProperty('--mouse-pos-y')
+                                       }
                                }, 300)
                        }
                },