Skip to content

Commit

Permalink
fix: Dropdown width
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Nov 1, 2023
1 parent fdfd73a commit f25033e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import './Dropdown.css'
const FONT_WIDTH = 12
const FONT_WEIGHT = 700
const WIDTH_CONST = 1200
const EMPTY_WIDTH_CONST = 1455
const ICON_SIZE = 16

function isOptionSelected(currentValue?: any, optionValue?: any) {
Expand Down Expand Up @@ -108,7 +109,7 @@ const Dropdown: React.FC<Props> = (props) => {
}, 0)
}

return ((empty?.length ?? 0) * FONT_WIDTH * FONT_WEIGHT) / WIDTH_CONST
return ((empty?.length ?? 0) * FONT_WIDTH * FONT_WEIGHT) / EMPTY_WIDTH_CONST
}, [options, empty])

return (
Expand Down

0 comments on commit f25033e

Please sign in to comment.