Readmore.js icon indicating copy to clipboard operation
Readmore.js copied to clipboard

Remove height and maxHeight entirely on destroy()

Open tadaskarpavicius opened this issue 4 years ago • 0 comments

Setting them to "initial" breaks the automatic maxHeight (set by the CSS) pickup. E.g. if the max-height set in the CSS uses relative units (rem, %, vh, vw, etc.), you want to "refresh" the readmore block on resize by destroying it and then initializing it again. That is currently impossible without clearing styles manually like so:

        const $el = readMore.elements[0];  
        readMore.destroy(readMore.elements[0]);  
        $el.style.height = '';  
        $el.style.maxHeight = '';  

tadaskarpavicius avatar Aug 09 '21 13:08 tadaskarpavicius