From d58066cfd20045d751c0aa23620f30e025f0e97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kopeck=C3=BD?= Date: Tue, 21 Dec 2021 09:58:27 +0100 Subject: [PATCH 1/3] #56 Add prop types for input --- packages/bootstrap/src/controls/input.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bootstrap/src/controls/input.tsx b/packages/bootstrap/src/controls/input.tsx index 288f857b..b8b8fc31 100644 --- a/packages/bootstrap/src/controls/input.tsx +++ b/packages/bootstrap/src/controls/input.tsx @@ -25,7 +25,7 @@ export function formatValueForControl(value: any) { export class Input extends ValidationControlBase< TTarget, - InputProps & FormControlProps & TOtherProps + InputProps & React.InputHTMLAttributes & FormControlProps & TOtherProps > { @bound protected renderInner() { From c89b913d46bcbf71c900dadd1714c733c4c9b55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kopeck=C3=BD?= Date: Tue, 21 Dec 2021 10:48:25 +0100 Subject: [PATCH 2/3] #56 Better support for FormControl props --- packages/bootstrap/src/controls/input.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/bootstrap/src/controls/input.tsx b/packages/bootstrap/src/controls/input.tsx index b8b8fc31..fa7369f0 100644 --- a/packages/bootstrap/src/controls/input.tsx +++ b/packages/bootstrap/src/controls/input.tsx @@ -1,6 +1,6 @@ import { bound } from "@frui.ts/helpers"; import * as React from "react"; -import { Form, FormControlProps } from "react-bootstrap"; +import { Form, FormControl } from "react-bootstrap"; import { ValidationControlBase } from "./validationControlBase"; export interface InputProps { @@ -25,7 +25,7 @@ export function formatValueForControl(value: any) { export class Input extends ValidationControlBase< TTarget, - InputProps & React.InputHTMLAttributes & FormControlProps & TOtherProps + InputProps & React.PropsWithRef & TOtherProps > { @bound protected renderInner() { From 7b3c990457f497f45f2697b25d9e46b32b01e8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kopeck=C3=BD?= Date: Tue, 21 Dec 2021 11:25:06 +0100 Subject: [PATCH 3/3] #56 Final solution --- packages/bootstrap/src/controls/input.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/bootstrap/src/controls/input.tsx b/packages/bootstrap/src/controls/input.tsx index fa7369f0..5038b5c3 100644 --- a/packages/bootstrap/src/controls/input.tsx +++ b/packages/bootstrap/src/controls/input.tsx @@ -1,8 +1,10 @@ import { bound } from "@frui.ts/helpers"; import * as React from "react"; -import { Form, FormControl } from "react-bootstrap"; +import { Form, FormControlProps } from "react-bootstrap"; import { ValidationControlBase } from "./validationControlBase"; +type FormControlElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; + export interface InputProps { onBlur?: (e: React.FormEvent) => void; onFocus?: (e: React.FormEvent) => void; @@ -25,7 +27,7 @@ export function formatValueForControl(value: any) { export class Input extends ValidationControlBase< TTarget, - InputProps & React.PropsWithRef & TOtherProps + InputProps & React.InputHTMLAttributes & FormControlProps & TOtherProps > { @bound protected renderInner() {