0

Having a div with dynamic content of scrollable logs, how can I make a transition when it shows/hide
I need its height gradually increase/decrease.

<div className={logsClass}>
    <div className={isOpened ? 'show' : 'hide'}>
       <p dangerouslySetInnerHTML={{__html: formatNote(props.logs)}}/>
       <div ref={dummy} className='a' />
    </div>
</div>

Here is my CSS:

.show{
   opacity: 1;
   visibility: visible;
}

.hide{
    visibility : hidden; 
    opacity: 0 
}

.rc_logsContent {
    overflow-y: auto;
    background-color: #2b2b2b;
    color: white;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 5px;
    transition: height 500ms;
}
mshadi
  • 111
  • 5
  • This might help you https://stackoverflow.com/questions/3508605/how-can-i-transition-height-0-to-height-auto-using-css – Eisa Rezaei May 15 '22 at 12:43

0 Answers0