tritonJS826 / masters-way

38 stars 40 forks source link

Rework Dropdown component to use 'react-dropdown-menu' instead of 'react-dialog' #1273

Open algrinkevich opened 2 months ago

algrinkevich commented 2 months ago

In Dropdown.tsx module I suggest replace "@radix-ui/react-dialog" library with "@radix-ui/react-dropdown-menu", because

  1. It is semantically correct (dialog != dropdown-menu);
  2. With the current approach, we should always position the dropdown relative to a trigger button. At the same time, "@radix-ui/react-dropdown-menu" positions it correctly out of the box, so less code is needed;
  3. The current dropdown does not work the way a normal dropdown should - when clicking on a menu item, the dropdown does not close. I suppose "@radix-ui/react-dropdown-menu" should have it out of the box. See the video below:

Screencast from 09-07-24 23:25:04.webm

algrinkevich commented 2 months ago

@tritonJS826 @Ekaterina1994 What do you think?

Ekaterina1994 commented 2 weeks ago
Ekaterina1994 commented 1 week ago

Done