Skip to content

Commit

Permalink
forwardRef bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaap-Hein Wester committed Dec 31, 2024
1 parent 315d938 commit ea46d13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/components-react/src/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import {
} from '@utrecht/component-library-react/dist/css-module';
import './Select.css';
import clsx from 'clsx';
import { forwardRef } from 'react';
import { ForwardedRef, forwardRef } from 'react';

export type LuxSelectProps = UtrechtSelectProps;
export type LuxSelectOptionProps = UtrechtSelectOptionProps;

export const LuxSelect = forwardRef((props: LuxSelectProps) => {
export const LuxSelect = forwardRef((props: LuxSelectProps, ref: ForwardedRef<HTMLSelectElement>) => {
const { className, ...restProps } = props;

return <UtrechtSelect className={clsx(className, 'lux-select')} {...restProps} />;
return <UtrechtSelect ref={ref} className={clsx(className, 'lux-select')} {...restProps} />;
});

export const LuxSelectOption = SelectOption;
Expand Down

0 comments on commit ea46d13

Please sign in to comment.