Skip to content

Conversation

@tadaskarpavicius
Copy link

@tadaskarpavicius tadaskarpavicius commented Aug 9, 2021

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 = '';  

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 = '';
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant