Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove height and maxHeight entirely on destroy() #253

Open
wants to merge 1 commit into
base: version-3.0
Choose a base branch
from
Open

Remove height and maxHeight entirely on destroy() #253

wants to merge 1 commit into from

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