@abgov/jsonforms-components 1.41.3 → 1.41.5
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/index.esm.js +23 -8
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -4581,6 +4581,16 @@ const Dropdown = props => {
|
|
|
4581
4581
|
}
|
|
4582
4582
|
setIsOpen(false);
|
|
4583
4583
|
};
|
|
4584
|
+
const setInputTextFocus = () => {
|
|
4585
|
+
const inputEl = document.getElementById(`${id}-input`);
|
|
4586
|
+
if (inputEl) {
|
|
4587
|
+
//The 'focused' property is part of the GoAInput component that is used to
|
|
4588
|
+
//set focus on the input field. We need to set it back to false once we set focus on the input field. Doing with just .focus() doesnt work.
|
|
4589
|
+
inputEl.focused = true;
|
|
4590
|
+
inputEl.focus();
|
|
4591
|
+
inputEl.focused = false;
|
|
4592
|
+
}
|
|
4593
|
+
};
|
|
4584
4594
|
const setElementFocus = (e, element, preventDefault) => {
|
|
4585
4595
|
if (element) {
|
|
4586
4596
|
element.focus();
|
|
@@ -4601,6 +4611,7 @@ const Dropdown = props => {
|
|
|
4601
4611
|
if (e.key === ENTER_KEY || e.key === SPACE_KEY) {
|
|
4602
4612
|
setIsOpen(previousIsOpen => !previousIsOpen);
|
|
4603
4613
|
const el = document.getElementById(`${PREFIX}-${label}-${(_a = items.at(0)) === null || _a === void 0 ? void 0 : _a.value}`);
|
|
4614
|
+
setInputTextFocus();
|
|
4604
4615
|
setElementFocus(e, el, false);
|
|
4605
4616
|
} else if (e.key === ARROW_UP_KEY) {
|
|
4606
4617
|
setIsOpen(true);
|
|
@@ -4637,14 +4648,7 @@ const Dropdown = props => {
|
|
|
4637
4648
|
var _a, _b, _c, _d;
|
|
4638
4649
|
if (e.key === ENTER_KEY || e.key === SPACE_KEY) {
|
|
4639
4650
|
updateDropDownData(item);
|
|
4640
|
-
|
|
4641
|
-
if (inputEl) {
|
|
4642
|
-
//The 'focused' property is part of the GoAInput component that is used to
|
|
4643
|
-
//set focus on the input field. We need to set it back to false once we set focus on the input field. Doing with just .focus() doesnt work.
|
|
4644
|
-
inputEl.focused = true;
|
|
4645
|
-
inputEl.focus();
|
|
4646
|
-
inputEl.focused = false;
|
|
4647
|
-
}
|
|
4651
|
+
setInputTextFocus();
|
|
4648
4652
|
}
|
|
4649
4653
|
if (e.key === ESCAPE_KEY) {
|
|
4650
4654
|
setIsOpen(false);
|
|
@@ -6374,6 +6378,17 @@ const DeleteDialog = /*#__PURE__*/React.memo(function DeleteDialog({
|
|
|
6374
6378
|
title,
|
|
6375
6379
|
message
|
|
6376
6380
|
}) {
|
|
6381
|
+
useEffect(() => {
|
|
6382
|
+
if (open) {
|
|
6383
|
+
const deleteBtn = document.querySelector('[data-testId="object-array-confirm-button"]');
|
|
6384
|
+
if (deleteBtn) {
|
|
6385
|
+
setTimeout(() => {
|
|
6386
|
+
var _a, _b;
|
|
6387
|
+
(_b = (_a = deleteBtn.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('button')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
6388
|
+
}, 200);
|
|
6389
|
+
}
|
|
6390
|
+
}
|
|
6391
|
+
}, [open]);
|
|
6377
6392
|
return jsxs(GoAModal, {
|
|
6378
6393
|
open: open,
|
|
6379
6394
|
testId: "object-array-modal",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.41.
|
|
3
|
+
"version": "1.41.5",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|