From 7b1d3907340d40bb60098b01bfb7b2e34ba9e7f1 Mon Sep 17 00:00:00 2001
From: Renaud Chaput <renchap@gmail.com>
Date: Tue, 19 Dec 2023 11:47:53 +0100
Subject: [PATCH] Fixes dropdown target without a `buttonRef` (edit history)
 (#28427)

---
 app/javascript/mastodon/components/dropdown_menu.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/javascript/mastodon/components/dropdown_menu.jsx b/app/javascript/mastodon/components/dropdown_menu.jsx
index de540b392b..d9cbcc32e5 100644
--- a/app/javascript/mastodon/components/dropdown_menu.jsx
+++ b/app/javascript/mastodon/components/dropdown_menu.jsx
@@ -257,7 +257,7 @@ class Dropdown extends PureComponent {
   };
 
   findTarget = () => {
-    return this.target?.buttonRef?.current;
+    return this.target?.buttonRef?.current ?? this.target;
   };
 
   componentWillUnmount = () => {