@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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -1
  2. 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
- !!errorMessage || controlledOrUncontrolledFiles.length === 0 && /*#__PURE__*/ jsx(ErrorMessageOrFieldError, {
1763
+ (controlledOrUncontrolledFiles.length === 0 || !!errorMessage) && /*#__PURE__*/ jsx(ErrorMessageOrFieldError, {
1761
1764
  errorMessage: errorMessage
1762
1765
  })
1763
1766
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obosbbl/grunnmuren-react",
3
- "version": "2.0.0-canary.55",
3
+ "version": "2.0.0-canary.56",
4
4
  "description": "Grunnmuren components in React",
5
5
  "repository": {
6
6
  "url": "https://github.com/code-obos/grunnmuren"