@via-profit/ui-kit 0.1.0-rc.78 → 0.1.0-rc.79
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.
|
@@ -64,17 +64,16 @@ const ModalWrapper = props => {
|
|
|
64
64
|
* The last dialog will be found and closed
|
|
65
65
|
*/
|
|
66
66
|
const keyDown = (event) => {
|
|
67
|
-
var _a, _b, _c;
|
|
68
|
-
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
|
+
const key = ((_a = event === null || event === void 0 ? void 0 : event.key) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
|
|
69
|
+
if (key === 'escape' && closeOnEscape) {
|
|
69
70
|
const portal = window.document.querySelector(`#${context_1.PORTAL_ID}`);
|
|
70
|
-
const lastID = (
|
|
71
|
+
const lastID = (_d = (_b = portal === null || portal === void 0 ? void 0 : portal.children) === null || _b === void 0 ? void 0 : _b[((_c = portal === null || portal === void 0 ? void 0 : portal.childNodes) === null || _c === void 0 ? void 0 : _c.length) - 1]) === null || _d === void 0 ? void 0 : _d.id;
|
|
71
72
|
if (lastID === id) {
|
|
72
73
|
onRequestClose(event);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
if (
|
|
76
|
-
isOpenProp &&
|
|
77
|
-
TabManager_1.default.isCurrentContainer(containerRef.current)) {
|
|
76
|
+
if (key === 'tab' && isOpenProp && TabManager_1.default.isCurrentContainer(containerRef.current)) {
|
|
78
77
|
event.preventDefault();
|
|
79
78
|
if (event.shiftKey) {
|
|
80
79
|
TabManager_1.default.focusPrev();
|