Skip to content

Commit

Permalink
feat(interface/input): minLength & maxLength option (overextended#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipeCuco authored May 8, 2023
1 parent 1d65379 commit 9a0fc24
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/src/features/dialog/components/fields/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const InputField: React.FC<Props> = (props) => {
description={props.row.description}
icon={props.row.icon && <FontAwesomeIcon icon={props.row.icon} fixedWidth />}
placeholder={props.row.placeholder}
minLength={props.row.min}
maxLength={props.row.max}
disabled={props.row.disabled}
withAsterisk={props.row.required}
/>
Expand All @@ -40,6 +42,8 @@ const InputField: React.FC<Props> = (props) => {
description={props.row.description}
icon={props.row.icon && <FontAwesomeIcon icon={props.row.icon} fixedWidth />}
placeholder={props.row.placeholder}
minLength={props.row.min}
maxLength={props.row.max}
disabled={props.row.disabled}
withAsterisk={props.row.required}
visibilityToggleIcon={({ reveal, size }) => (
Expand Down
2 changes: 2 additions & 0 deletions web/src/typings/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type BaseField<T, U> = {

export interface IInput extends BaseField<'input', string> {
password?: boolean;
min?: number;
max?: number;
}

export interface ICheckbox {
Expand Down

0 comments on commit 9a0fc24

Please sign in to comment.