Skip to content

Commit

Permalink
fix: minimum select width (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt authored Dec 7, 2024
1 parent 6e346fc commit 252039b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/input-elements/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";
import React, { useMemo } from "react";
import { tremorTwMerge } from "lib";
import React, { useMemo } from "react";
import { DayPickerSingleProps } from "react-day-picker";

import { startOfMonth, startOfToday } from "date-fns";
Expand Down
2 changes: 1 addition & 1 deletion src/components/input-elements/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const MultiSelect = React.forwardRef<HTMLInputElement, MultiSelectProps>((props,
anchor="bottom start"
className={tremorTwMerge(
// common
"z-10 divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]",
"z-10 divide-y w-[var(--button-width)] overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]",
// light
"bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown",
// dark
Expand Down
18 changes: 9 additions & 9 deletions src/components/input-elements/SearchSelect/SearchSelect.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
"use client";
import React, { isValidElement, useMemo, useRef } from "react";
import { useInternalState } from "hooks";
import React, { isValidElement, useMemo, useRef } from "react";

import {
Combobox,
ComboboxButton,
ComboboxInput,
ComboboxOptions,
Transition,
} from "@headlessui/react";
import { ArrowDownHeadIcon, XCircleIcon } from "assets";
import { makeClassName, tremorTwMerge } from "lib";
import {
Expand All @@ -10,13 +17,6 @@ import {
getSelectButtonColors,
hasValue,
} from "../selectUtils";
import {
Combobox,
ComboboxButton,
ComboboxInput,
ComboboxOptions,
Transition,
} from "@headlessui/react";

const makeSearchSelectClassName = makeClassName("SearchSelect");

Expand Down Expand Up @@ -237,7 +237,7 @@ const SearchSelect = React.forwardRef<HTMLInputElement, SearchSelectProps>((prop
anchor="bottom start"
className={tremorTwMerge(
// common
"z-10 divide-y overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] border [--anchor-gap:4px]",
"z-10 divide-y w-[var(--button-width)] overflow-y-auto outline-none rounded-tremor-default text-tremor-default max-h-[228px] border [--anchor-gap:4px]",
// light
"bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown",
// dark
Expand Down
4 changes: 2 additions & 2 deletions src/components/input-elements/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use client";

import React, { isValidElement, useMemo, Children, useRef } from "react";
import { ArrowDownHeadIcon, XCircleIcon } from "assets";
import { makeClassName, tremorTwMerge } from "lib";
import React, { Children, isValidElement, useMemo, useRef } from "react";
import { constructValueToNameMapping, getSelectButtonColors, hasValue } from "../selectUtils";

import { Listbox, ListboxButton, ListboxOptions, Transition } from "@headlessui/react";
Expand Down Expand Up @@ -199,7 +199,7 @@ const Select = React.forwardRef<HTMLInputElement, SelectProps>((props, ref) => {
anchor="bottom start"
className={tremorTwMerge(
// common
"z-10 divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]",
"z-10 w-[var(--button-width)] divide-y overflow-y-auto outline-none rounded-tremor-default max-h-[228px] border [--anchor-gap:4px]",
// light
"bg-tremor-background border-tremor-border divide-tremor-border shadow-tremor-dropdown",
// dark
Expand Down

0 comments on commit 252039b

Please sign in to comment.