Skip to content

Commit 5450fd7

Browse files
committed
fix: select size
1 parent c2b5717 commit 5450fd7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/Select.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ import React, {
2222
ElementType,
2323
ReactNode,
2424
useEffect,
25+
useImperativeHandle,
2526
useLayoutEffect,
2627
useRef,
2728
useState
2829
} from 'react'
29-
import { PC, PP } from '../types/PolymorphicElementProps'
30+
import { PC, PP, PR } from '../types/PolymorphicElementProps'
3031
import { cssClickable, cssDisablable } from '../utils/styles'
3132
import { ListItem } from './$List'
3233

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

7275
export const Select: PC<'button', SelectProps> = React.forwardRef(
7376
<T extends ElementType, E extends SelectItemNode>(
74-
props: PP<T, SelectProps<E>>
75-
// ref?: PR<T>
77+
props: PP<T, SelectProps<E>>,
78+
ref?: PR<T>
7679
) => {
7780
const {
7881
fullWidth = false,
@@ -150,6 +153,8 @@ export const Select: PC<'button', SelectProps> = React.forwardRef(
150153
],
151154
})
152155

156+
useImperativeHandle(ref, () => reference)
157+
153158
const { getReferenceProps, getFloatingProps, getItemProps } =
154159
useInteractions([
155160
useClick(context, { pointerDown: true }),

0 commit comments

Comments
 (0)