predixdesignsystem / px-breadcrumbs

https://www.predix-ui.com/#/elements/px-breadcrumbs
Apache License 2.0
0 stars 2 forks source link

px-breadcrumb dropdown content is not loading when isSelectable set to false for the first item #26

Open psmanideep opened 4 years ago

psmanideep commented 4 years ago

Expected behavior and actual behavior

Expected: Drop down should show the list of siblings on click of breadcrumb dropdown when isSelectable property is set to false. Actual: Drop down is not showing, showing a black thin line.

Steps to reproduce the problem

  1. add "isSelectable": false to an item (at any level i.e super parent, parent, child, sub child) of items array.
  2. Below is an example of items array, items = [{ "label": "North America", "id": "North America", "isSelectable": false, "children": [{ "label": "United States of America", "id": "United States of America", "isSelectable": false, "children": [{ "label": "California", "id": "California", "isSelectable": false },{ "label": "Colorado", "id": "Colorado", "isSelectable": true }]},{ "label": "United States of America - 2", "id": "United States of America - 2", "isSelectable": true, "children": [{ "label": "xyz", "id": "xyz", "isSelectable": true }] }]},{ "label": "South America", "id": "South America", "isSelectable": true }];
  3. Navigate to Colorado
  4. Open the breadcrumb dropdown of Colorado's parent i.e. United States of America ( which has isSelectable:false) - dropdown content won't be shown, will be shown a black thin line.

Environment

Bower - v1.1.6 Google Chrome - Version 78.0.3904.108 (Official Build) (64-bit) Operating System - Windows 10

Screenshots

Actual:

Expected: image

Code Fix

Below is the expected code fix File name: px-breadcrumbs.html _onPathTap(evt) {

  ## Comment the following line of code ##
  if(dataItem.isSelectable === false) return;

}