@salesforcedevs/dx-components 1.40.0-docs-feedback-2 → 1.40.0-docs-feedback-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.40.0-docs-feedback-2",
3
+ "version": "1.40.0-docs-feedback-3",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -46,9 +46,16 @@ export default class TreeTile extends LightningElement {
46
46
  if (!this.treeNode.redirectToChild || !this.treeNode.link?.href) {
47
47
  return null;
48
48
  }
49
- const destinationLabel = this.treeNode.children?.[0]?.label;
50
- return destinationLabel
51
- ? `${this.treeNode.label}, opens ${destinationLabel}`
49
+ /**
50
+ * TThe redirect can target a deep descendant, so walk the first-child
51
+ * chain to the node that owns the destination link and name it.
52
+ */
53
+ let destination = this.treeNode.children?.[0];
54
+ while (destination?.redirectToChild) {
55
+ destination = destination.children?.[0];
56
+ }
57
+ return destination?.link?.href === this.treeNode.link.href
58
+ ? `${this.treeNode.label}, opens ${destination.label}`
52
59
  : null;
53
60
  }
54
61