@ukhomeoffice/cop-react-form-renderer 5.97.1 → 5.97.3
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.
|
@@ -118,11 +118,13 @@ var Collection = function Collection(_ref) {
|
|
|
118
118
|
(0, _react.useEffect)(function () {
|
|
119
119
|
if (config.focusOnAdd && Array.isArray(value) && value.length) {
|
|
120
120
|
if (value.length > config.minimumEntries || !config.minimumEntries) {
|
|
121
|
-
var _value2, _document$getElementB
|
|
121
|
+
var _value2, _document$getElementB;
|
|
122
122
|
var containerId = (_value2 = value[value.length - 1]) === null || _value2 === void 0 ? void 0 : _value2.id;
|
|
123
123
|
var container = (_document$getElementB = document.getElementById(containerId)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.childNodes[0];
|
|
124
124
|
var focusable = container === null || container === void 0 ? void 0 : container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
125
|
-
(
|
|
125
|
+
if (focusable && focusable.length > 0) {
|
|
126
|
+
focusable[0].focus();
|
|
127
|
+
}
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
}, [value.length, config.focusOnAdd, config.minimumEntries]);
|
|
@@ -140,7 +142,7 @@ var Collection = function Collection(_ref) {
|
|
|
140
142
|
id: config.id,
|
|
141
143
|
required: config.required,
|
|
142
144
|
className: classes('title')
|
|
143
|
-
}, config.label), value && value.map(function (item, index) {
|
|
145
|
+
}, config.label), Array.isArray(value) && value.map(function (item, index) {
|
|
144
146
|
var _config$removeLocatio;
|
|
145
147
|
var fullPath = "".concat(config.full_path || config.fieldId, "[").concat(index, "]");
|
|
146
148
|
var labelCount = (config.countOffset || 0) + index + 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ukhomeoffice/cop-react-form-renderer",
|
|
3
|
-
"version": "5.97.
|
|
3
|
+
"version": "5.97.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"post-compile": "rimraf dist/*.test.* dist/**/*.test.* dist/**/*.stories.* dist/docs dist/assets"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@ukhomeoffice/cop-react-components": "3.24.
|
|
19
|
+
"@ukhomeoffice/cop-react-components": "^3.24.4",
|
|
20
20
|
"axios": "^0.23.0",
|
|
21
21
|
"dayjs": "^1.11.0",
|
|
22
22
|
"govuk-frontend": "^4.3.1",
|
|
@@ -102,4 +102,4 @@
|
|
|
102
102
|
"last 1 safari version"
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
}
|