fix: dropdown menu not opening on avatar click
React synthetic event stopPropagation doesn't stop native document listeners (React 17+ attaches to root, document listener is separate). The document click handler was closing the menu right after avatar opened it. Now it checks if the click target is inside the dropdown or on the avatar and skips closing.
This commit is contained in:
1 parent
2a508d1b21
commit
c171efc1ec
5 files changed
+38
-9
No files matched your search
@@ -10,7 +10,7 @@ export async function PUT(req, { params }) {
|
||||
}
|
||||
|
||||
const body = await req.json();
|
||||
const { username, bio, role } = body;
|
||||
const { username, bio, signature, role } = body;
|
||||
|
||||
// 改角色:仅管理员
|
||||
if (role !== undefined) {
|
||||
|
||||
Reference in new issue
Block a user