@ukhomeoffice/cop-react-form-renderer 4.33.3 → 4.34.0
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.
|
@@ -73,14 +73,13 @@ var FormPage = function FormPage(_ref) {
|
|
|
73
73
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
74
74
|
patchLabel = _useState4[0],
|
|
75
75
|
setPatchLabel = _useState4[1];
|
|
76
|
-
|
|
77
|
-
var docTitle = (0, _react.useState)(document.title);
|
|
78
76
|
/**
|
|
79
77
|
* Handle the state of the data directly within the page.
|
|
80
78
|
* This is so that the overall form data isn't affected until such
|
|
81
79
|
* time as the onAction handler is invoked.
|
|
82
80
|
*/
|
|
83
81
|
|
|
82
|
+
|
|
84
83
|
var onPageChange = function onPageChange(_ref2) {
|
|
85
84
|
var target = _ref2.target;
|
|
86
85
|
page.formData[target.name] = target.value;
|
|
@@ -93,8 +92,9 @@ var FormPage = function FormPage(_ref) {
|
|
|
93
92
|
};
|
|
94
93
|
|
|
95
94
|
(0, _react.useEffect)(function () {
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
var coreDocTitle = document.title.replace('Error: ', '');
|
|
96
|
+
document.title = errors.length > 0 ? 'Error: ' + coreDocTitle : coreDocTitle;
|
|
97
|
+
}, [errors]);
|
|
98
98
|
|
|
99
99
|
var classes = _utils.default.classBuilder(classBlock, classModifiers, className);
|
|
100
100
|
|