Skip to content

Commit

Permalink
feat: Added props onFocus and onClick to component TextInputFormatted (
Browse files Browse the repository at this point in the history
  • Loading branch information
egeofalcao authored Nov 11, 2022
1 parent 4e6414a commit 86b453c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/lui/TextInputFormatted.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import "./TextInputFormatted.scss";

import { ChangeEventHandler, DetailedHTMLProps, InputHTMLAttributes } from "react";
import {
ChangeEventHandler,
DetailedHTMLProps,
FocusEventHandler,
InputHTMLAttributes,
MouseEventHandler,
} from "react";

import clsx from "clsx";
import { LuiIcon } from "@linzjs/lui";

export interface LuiTextInputProps {
onChange?: ChangeEventHandler<HTMLInputElement>;
onFocus?: FocusEventHandler<HTMLInputElement>;
onClick?: MouseEventHandler<HTMLInputElement>;
inputProps?: DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
error?: string | boolean | null;
warning?: string | boolean | null;
Expand Down Expand Up @@ -38,6 +46,8 @@ export const TextInputFormatted = (props: LuiTextInputProps): JSX.Element => {
spellCheck={true}
defaultValue={props.value}
onChange={props.onChange}
onFocus={props.onFocus}
onClick={props.onClick}
{...props.inputProps}
/>
<span className={"LuiTextInput-formatted"}>{props.formatted}</span>
Expand Down

0 comments on commit 86b453c

Please sign in to comment.