Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Move the TAC to above the button (#12438)
Browse files Browse the repository at this point in the history
* Move the TAC to above the button

This isn't what the designs say, but there is a (bug/feature)* in
radix where it will turn a mouseup event within the menu into a
click so that it activates the menu option that's under your cursor
when you lift the button, even if you pressed the button down on
a different item. Unfortunately it forgot to check that the mouse
down happened in the menu, so if the menu appears under the cursor,
the cursor, it will immediately select whatever option appeared under
the cursor.

I think the simplest solution here is to just move the menu above the
TAC button. This also makes it consistent† with quick settings.

*delete as applicable
†Not actually consistent because it fades in a different way

* Update snapshots
  • Loading branch information
dbkr authored Apr 19, 2024
1 parent 198b975 commit cc7edad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCen
</ReleaseAnnouncement>
) : (
<Menu
align="end"
align="start"
side="top"
open={open}
onOpenChange={(newOpen) => {
// Track only when the Threads Activity Centre is opened
if (newOpen) PosthogTrackers.trackInteraction("WebThreadsActivityCentreButton");

setOpen(newOpen);
}}
side="right"
title={_t("threads_activity_centre|header")}
trigger={
<ThreadsActivityCentreButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ exports[`ThreadsActivityCentre renders notifications matching the snapshot 1`] =
aria-labelledby="radix-14"
aria-orientation="vertical"
class="_menu_1x5h1_17"
data-align="end"
data-align="start"
data-orientation="vertical"
data-radix-menu-content=""
data-side="right"
data-side="top"
data-state="open"
dir="ltr"
id="radix-15"
Expand Down Expand Up @@ -130,10 +130,10 @@ exports[`ThreadsActivityCentre should match snapshot when empty 1`] = `
aria-labelledby="radix-20"
aria-orientation="vertical"
class="_menu_1x5h1_17"
data-align="end"
data-align="start"
data-orientation="vertical"
data-radix-menu-content=""
data-side="right"
data-side="top"
data-state="open"
dir="ltr"
id="radix-21"
Expand Down Expand Up @@ -164,10 +164,10 @@ exports[`ThreadsActivityCentre should order the room with the same notification
aria-labelledby="radix-22"
aria-orientation="vertical"
class="_menu_1x5h1_17"
data-align="end"
data-align="start"
data-orientation="vertical"
data-radix-menu-content=""
data-side="right"
data-side="top"
data-state="open"
dir="ltr"
id="radix-23"
Expand Down

0 comments on commit cc7edad

Please sign in to comment.