Skip to content

Commit

Permalink
fix: select size
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftpsh committed Jul 26, 2022
1 parent c2b5717 commit 5450fd7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ import React, {
ElementType,
ReactNode,
useEffect,
useImperativeHandle,
useLayoutEffect,
useRef,
useState
} from 'react'
import { PC, PP } from '../types/PolymorphicElementProps'
import { PC, PP, PR } from '../types/PolymorphicElementProps'
import { cssClickable, cssDisablable } from '../utils/styles'
import { ListItem } from './$List'

Expand All @@ -43,6 +44,8 @@ const SelectDisplay = styled.div<SelectDisplayProps>`
line-height: normal;
font-size: 1rem;
padding: 0.8em 0.5em;
padding-right: 48px;
max-width: 100%;
background: ${({ theme }) => theme.color.background.footer};
color: ${({ theme }) => theme.color.text.primary.main};
border: ${({ theme }) => theme.styles.border()};
Expand Down Expand Up @@ -71,8 +74,8 @@ export interface SelectProps<T extends SelectItemNode = string> {

export const Select: PC<'button', SelectProps> = React.forwardRef(
<T extends ElementType, E extends SelectItemNode>(
props: PP<T, SelectProps<E>>
// ref?: PR<T>
props: PP<T, SelectProps<E>>,
ref?: PR<T>
) => {
const {
fullWidth = false,
Expand Down Expand Up @@ -150,6 +153,8 @@ export const Select: PC<'button', SelectProps> = React.forwardRef(
],
})

useImperativeHandle(ref, () => reference)

const { getReferenceProps, getFloatingProps, getItemProps } =
useInteractions([
useClick(context, { pointerDown: true }),
Expand Down

0 comments on commit 5450fd7

Please sign in to comment.