@momentum-design/components 0.135.0 → 0.135.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.
|
@@ -500,13 +500,16 @@ class SpatialNavigationProvider extends Provider {
|
|
|
500
500
|
goBack() {
|
|
501
501
|
const goBackElement = findFocusable(this.root).find(el => el.hasAttribute(DATA_ATTRIBUTES.GO_BACK));
|
|
502
502
|
const isDefaultPrevented = this.emitGoBackEvent(goBackElement);
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
503
|
+
// Skip default behavior when event was prevented by the user
|
|
504
|
+
if (!isDefaultPrevented) {
|
|
505
|
+
if (goBackElement) {
|
|
506
|
+
goBackElement.click();
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
if (window.history.length > this.initialHistoryLength) {
|
|
510
|
+
window.history.back();
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
510
513
|
}
|
|
511
514
|
return false;
|
|
512
515
|
}
|
package/package.json
CHANGED