Skip to content

Commit 1e91cdf

Browse files
authored
feat: Be able to override props with native props (#274)
1 parent f401b25 commit 1e91cdf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ export const Input = memo(
137137
{(() => {
138138
const nativeInputOrTextArea = (
139139
<NativeInputOrTextArea
140-
{...(nativeInputOrTextAreaProps as {})}
141140
className={cx(
142141
fr.cx(
143142
"fr-input",
@@ -158,6 +157,7 @@ export const Input = memo(
158157
aria-describedby={messageId}
159158
type={textArea ? undefined : nativeInputProps?.type ?? "text"}
160159
id={inputId}
160+
{...(nativeInputOrTextAreaProps as {})}
161161
/>
162162
);
163163

src/Select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ export const Select = memo(
9595
{hint !== undefined && <span className={fr.cx("fr-hint-text")}>{hint}</span>}
9696
</label>
9797
<select
98-
{...nativeSelectProps}
9998
className={cx(fr.cx("fr-select"), nativeSelectProps.className)}
10099
id={selectId}
101100
aria-describedby={stateDescriptionId}
102101
disabled={disabled}
102+
{...nativeSelectProps}
103103
>
104104
{children}
105105
</select>

src/SelectNext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ function NonMemoizedNonForwardedSelect<T extends SelectProps.Option[]>(
145145
{hint !== undefined && <span className={fr.cx("fr-hint-text")}>{hint}</span>}
146146
</label>
147147
<select
148-
{...(nativeSelectProps as any)}
149148
className={cx(fr.cx("fr-select"), nativeSelectProps?.className)}
150149
id={selectId}
151150
aria-describedby={stateDescriptionId}
152151
disabled={disabled}
152+
{...(nativeSelectProps as any)}
153153
>
154154
{[
155155
{

0 commit comments

Comments
 (0)