vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.43k stars 762 forks source link

TreeView wrong rendering with ng-template and Ivy enabled #5514

Closed danail-vasilev closed 3 years ago

danail-vasilev commented 3 years ago

Describe the bug

TreeView has a wrong rendering when tree node is inside ng-template and Ivy is enabled - https://www.screencast.com/t/nnx0MATX96N and https://www.screencast.com/t/e4ePfy349T

How to reproduce

The issues is reproducible with Clarity3/Clarity4 - https://stackblitz.com/edit/clarity-v3-dark-theme-r12emw Ivy can be enabled from Stackblitz settings.

Jinnie commented 3 years ago

I reproduced this. I find it's related to the ng-template projection. Ivy seems to over-simplify the generated html. Suggestions for workaround are to try avoiding the ng-template and if needed, use a small child component, like this: https://stackblitz.com/edit/clarity-issue-5514-workaround?file=src%2Fapp%2Fapp.component.ts

Jinnie commented 3 years ago

There is a workaround available for this issue, and we recommend using it for Clarity Angular. We would consider a contribution to address this issue if someone is able to work out a solution. To help us clean up our backlog, we are going to close this with a functional workaround available and suggest you follow updates for Clarity Core for enhancements that can support your use case with Clarity Core components.

danail-vasilev commented 3 years ago

Hello, Thanks but is this issue reproducible in Core ? If this is so I think the bug must be cloned for Core. Regards

mathisscott commented 3 years ago

@danail-vasilev Presently, there is no tree view in Clarity Core. We are working as quickly as we can to implement Core components. When tree view is available in the Clarity Core components, we will keep this use case in mind. I see no reason why it would not work, though, based on my experience with Angular and the Core components we already have.

Jinnie commented 3 years ago

Core components are designed to be a lot more flexible, giving more control and freedom in the hands of the component user (application developer). CC @gnomeontherun pinging Jeremy to make sure if we need to specifically add this request to the Core development considerations for the tree component.

gnomeontherun commented 3 years ago

We don't need a bug report for something that doesn't even exist yet. This is not needed to be copied because Core architecture will be independent of Angular and some of this quirky issues that exist with Angular.