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

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

  •  15-07-2023
  •  | 
  •  

Pergunta

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

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top