Attribute changed for parent outside of ShadowDom (display: none -> display: flex -> display: none)

StackOverflow https://stackoverflow.com/questions/23470266

  •  15-07-2023
  •  | 
  •  

My Angular-Component lives inside a flexbox (id="log") The flexbox can be displayed or hidden. Inside of my component there is a scrollable area which displays log messages. (id="message-list") The height of message-list has to be set programmatically set according to the parents size. (And YES - it has to be set programmatically, worked on this several hours)

The problem is - I don't know when the parent (log (outside of component)) is changing it's state. onShadowRoot does not help because it's called when the Component is inserted into SR which has nothing todo with its visibility.

thx for a hint.

enter image description here

有帮助吗?

解决方案

I built a Decorator/Directive that generates events when an element changes it's size. You could apply this to the parent. See my answer to How to scrollTop a div whose content is managed by AngularDart? for more details.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top