patternfly-elements icon indicating copy to clipboard operation
patternfly-elements copied to clipboard

[bug] pfe-band: Does not work with frameworks

Open kylebuch8 opened this issue 6 years ago • 3 comments

I've tested this component with Angular, React, and Vue and I get the same experience with all three frameworks. The band initially renders with just the default slot content.

Screen Shot 2019-10-25 at 1 21 32 PM

Even though my test is using the header, aside, and footer slots, those areas do not render. However, if I call the render method on pfe-band after the page loads, those slots become visible.

Screen Shot 2019-10-25 at 1 23 20 PM

kylebuch8 avatar Oct 25 '19 17:10 kylebuch8

Hi, I also have this issue with Angular. Angular remove at runtime all the attributes and this behaviour create random issues with Web Components. I fixed for the moment with the following code: carbon (4)

` constructor() { super(PfeBand, { type: PfeBand.PfeType }); this._init = this._init.bind(this); this._observer = new MutationObserver(this._init); }

connectedCallback() { super.connectedCallback(); if (this.children.length) { this.render(); this._init(); } this._observer.observe(this, { childList: true }); }

_init() { // Initialize the background image attachment if (this.imageSrc) { this._imgSrcChanged("pfe-img-src", "", this.imageSrc); } } `

grandemayta avatar Jun 25 '20 13:06 grandemayta

@kylebuch8 Is this still an issue? It looks like tests are passing for React and Vue. I suspect Angular is still a problem though.

castastrophe avatar May 25 '21 14:05 castastrophe

Is this still relevant with @patternfly/pfe-band@^2.0.0-next-0?

bennypowers avatar Feb 23 '22 22:02 bennypowers