Skip to content

Commit

Permalink
Release 0.0.123
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jan 20, 2025
1 parent 07767db commit cc3c0d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@surfnet/sds",
"version": "0.0.122",
"version": "0.0.123",
"description": "SURF Design System for React",
"type": "module",
"main": "cjs/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/components/CodeValidation/CodeValidation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ const CodeValidation = (props: CodeValidationProps) => {
const disabled = props.disabled || false;

useEffect(() => {
const emptyValues = isEmpty(values.join(""));
if (props.clear) {
setValues(Array(props.size).fill(""));
}
if ((props.focusFirst || true) && !props.disabled) {
if (emptyValues && (props.focusFirst || true) && !props.disabled) {
const firstElement = inputRefs.current[0];
setTimeout(() => firstElement.focus(), timeout);
}
Expand Down

0 comments on commit cc3c0d1

Please sign in to comment.