predixdesignsystem / px-breadcrumbs

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

Set main path on asset graph created event #22

Closed sks closed 6 years ago

sks commented 6 years ago

Set Mainpath on initial render

Somehow,

I was running into the issue where the _mainPathItems was not set while initial render, hence the breadcrumbs was not showing up in the application.

<template is="dom-repeat" items="[[_mainPathItems]]">

So setting the _mainPathItems in the 'px-app-asset-graph-created events seems to fix it. Hence the change in _getBreadcrumbsObj method.

Not sure if this is the exact fix/ a hack.

Please let me know

I have been trying to create a codepen with the minimal settings, but have not been successful yet.

Will update the PR once I hit on this

davidrleonard commented 6 years ago

I see that there's a timing or order-of-operations issue here, but I'm not sure this is the right way to fix it. We moved all the setters for _mainPathItems to the _getDisplayMode() method for a reason, because deciding how to render the items must happen before we render them. I think we need a different fix to solve this problem.

sks commented 6 years ago

this might seem similar to #8

davidrleonard commented 6 years ago

If you can find a way to reproduce this in a minimal way, with codepen or something like glitch, we'll be able to look into it faster.

sks commented 6 years ago

On further investigation, found that

value of _ulWidth was set to 0

_onResize callback had the following values

breadcrumbsContainer = div.container.flex
breadcrumbsUlContainer = ul.topPath
bcUlContainerRect =  {"x":0,"y":0,"width":0,"height":0,"top":0,"right":0,"bottom":0,"left":0}

Hence the value of _ulWidth is set to 0

Not sure how this all adds up

davidrleonard commented 6 years ago

Please file an issue so we can work on this. If you can't reproduce, trying to give us screenshots of the current stack and as much information as possible will help. E.g. Polymer version, OS, browser version, the snippet of code that actually created the issue in your environment, screenshots, and so on.