@obosbbl/grunnmuren-react 2.0.0-canary.55 → 2.0.0-canary.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1742,6 +1742,9 @@ const FileUpload = ({ children, files: _files, onChange, validate, isInvalid: _i
|
|
|
1742
1742
|
onChange?.((prevFiles)=>prevFiles.filter((_, index)=>index !== fileIndex));
|
|
1743
1743
|
// For internal file state
|
|
1744
1744
|
setFiles((prevFiles)=>prevFiles.filter((_, index)=>index !== fileIndex));
|
|
1745
|
+
// Make sure screen readers doesn't loose track of focus
|
|
1746
|
+
// (without this, the focus will be set to the top of the page for screen readers)
|
|
1747
|
+
buttonRef.current?.focus();
|
|
1745
1748
|
},
|
|
1746
1749
|
"aria-label": translations.remove[locale],
|
|
1747
1750
|
type: "button",
|
|
@@ -1757,7 +1760,7 @@ const FileUpload = ({ children, files: _files, onChange, validate, isInvalid: _i
|
|
|
1757
1760
|
}, fileName);
|
|
1758
1761
|
})
|
|
1759
1762
|
}),
|
|
1760
|
-
|
|
1763
|
+
(controlledOrUncontrolledFiles.length === 0 || !!errorMessage) && /*#__PURE__*/ jsx(ErrorMessageOrFieldError, {
|
|
1761
1764
|
errorMessage: errorMessage
|
|
1762
1765
|
})
|
|
1763
1766
|
]
|