feat(select): enhance dropdown positioning and filtering functionality

- Introduced a new measureDropdownRect function to accurately position the dropdown menu based on viewport dimensions, improving usability.
- Updated the Select component to utilize the new dropdown measurement logic, ensuring consistent placement above or below the trigger.
- Refactored panelRect state management to use a more structured DropdownRect type, enhancing type safety and clarity.
- Improved event handling for dropdown visibility and positioning during scroll and resize events, ensuring a responsive user experience.
- Adjusted styling in related components for better alignment and visual consistency.
This commit is contained in:
AmirReza Jamali
2026-05-17 10:15:25 +03:30
parent de92137ec4
commit 0d8300493e
4 changed files with 133 additions and 178 deletions
@@ -5,6 +5,7 @@ import { Select } from "@/components/FormElements/select";
import { Button } from "@/components/ui-elements/button";
import InlineListFiltersPanel from "@/components/ui/InlineListFiltersPanel";
import { Currencies } from "@/constants/enums";
import { useMemo } from "react";
import {
FieldValues,
UseFormHandleSubmit,
@@ -12,7 +13,6 @@ import {
UseFormSetValue,
UseFormWatch,
} from "react-hook-form";
import { useMemo } from "react";
interface CompanyListFiltersProps {
filterRegister: UseFormRegister<FieldValues>;
@@ -60,7 +60,6 @@ const CompanyListFilters = ({
return (
<InlineListFiltersPanel
title="Filter companies"
description="Filter by identity, currency, or headcount — inline, no popup."
activeFilterCount={activeCount}
expandAriaLabel="Expand company filters"
collapseAriaLabel="Collapse company filters"