Skip to content

Commit

Permalink
feat: add well blur in field
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOliveiraM committed Nov 2, 2022
1 parent 11d8b50 commit 7f0d8c5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"react",
"typescript"
],
"version": "2.1.4",
"version": "2.1.5",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
Expand Down
16 changes: 16 additions & 0 deletions src/components/molecules/Fields/Field/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ const Field = forwardRef<HTMLInputElement, FieldProps>((props, ref) => {
alt={alt}
autoFocus={autoFocus}
autoComplete={browserAutoComplete}
onWheel={e => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const target = e?.target as any

if (typeof target?.blur === 'function') {
target.blur()
}
}}
/>
</>
) : (
Expand All @@ -181,6 +189,14 @@ const Field = forwardRef<HTMLInputElement, FieldProps>((props, ref) => {
alt={alt}
autoFocus={autoFocus}
autoComplete={browserAutoComplete}
onWheel={e => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const target = e?.target as any

if (typeof target?.blur === 'function') {
target.blur()
}
}}
/>
)}
{type !== 'file' && (sufixElement || null)}
Expand Down

0 comments on commit 7f0d8c5

Please sign in to comment.