@salesforcedevs/dx-components 1.3.41 → 1.3.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.3.41",
3
+ "version": "1.3.42",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -40,5 +40,5 @@
40
40
  "eventsourcemock": "^2.0.0",
41
41
  "luxon": "^3.1.0"
42
42
  },
43
- "gitHead": "46a0b7fd6aa2964c2cc9301c402b8ab8cf98e4bf"
43
+ "gitHead": "a5ddc2bf9e25ef6d9c937086335387a23f647e91"
44
44
  }
@@ -97,10 +97,18 @@ export default class TreeItem extends LightningElement {
97
97
  this.sendGtm(event);
98
98
  }
99
99
 
100
- private onLinkClick(event: Event): void {
101
- if (!(this._treeNode.link && this._treeNode.link.href)) {
100
+ private preventDefaultLinkBehavior(event: Event) {
101
+ // prevent page refresh if href isn't present or link is already active
102
+ if (
103
+ !this._treeNode.link?.href ||
104
+ this._treeNode.link?.href === window.location.pathname
105
+ ) {
102
106
  event.preventDefault();
103
107
  }
108
+ }
109
+
110
+ private onLinkClick(event: Event): void {
111
+ this.preventDefaultLinkBehavior(event);
104
112
 
105
113
  if (this.isParent) {
106
114
  const isSelectAction = true;