@linzjs/lui 17.23.0 → 17.23.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [17.23.1](https://github.com/linz/lui/compare/v17.23.0...v17.23.1) (2022-11-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * allow modals to opt out of auto focus ([#802](https://github.com/linz/lui/issues/802)) ([038d279](https://github.com/linz/lui/commit/038d2791e6b99c54a31e05a2cc3fdf8f9c4a6289))
7
+
1
8
  # [17.23.0](https://github.com/linz/lui/compare/v17.22.0...v17.23.0) (2022-11-23)
2
9
 
3
10
  # [17.22.0](https://github.com/linz/lui/compare/v17.21.1...v17.22.0) (2022-11-18)
@@ -7,6 +7,7 @@ interface ILuiModal {
7
7
  maxWidth?: boolean;
8
8
  headingText?: string;
9
9
  lowContrast?: boolean;
10
+ preventAutoFocus?: boolean;
10
11
  appendToElement?: () => HTMLElement;
11
12
  }
12
13
  export declare const LuiModal: React.FC<React.PropsWithChildren<ILuiModal>>;
package/dist/index.js CHANGED
@@ -28237,7 +28237,8 @@ var LuiModal = function (props) {
28237
28237
  React__default["default"].createElement("div", { ref: node, className: clsx('lui-modal lui-box-shadow', props.maxWidth && 'lui-max-width', props.headingText && 'lui-modal-no-padding', props.className) },
28238
28238
  props.headingText && (React__default["default"].createElement(LuiModalHeader, { headingText: props.headingText, onClose: props.onClose })),
28239
28239
  React__default["default"].createElement("div", { className: clsx(props.headingText && 'lui-modal-container'), ref: function (element) {
28240
- if (element &&
28240
+ if (!props.preventAutoFocus &&
28241
+ element &&
28241
28242
  !element.contains(element.ownerDocument.activeElement)) {
28242
28243
  var firstFocusableElement = element.querySelector('input,button');
28243
28244
  firstFocusableElement === null || firstFocusableElement === void 0 ? void 0 : firstFocusableElement.focus();