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

Big white space after open text block #234

Open
Pupinia opened this issue Mar 15, 2019 · 8 comments
Open

Big white space after open text block #234

Pupinia opened this issue Mar 15, 2019 · 8 comments

Comments

@Pupinia
Copy link

Pupinia commented Mar 15, 2019

I think i have same issue After click on 'read more' i have big white space in bottom my block.
Version chrome on mobile - 72.

@rawthriver
Copy link

rawthriver commented Jan 25, 2020

+1. Still actual in v3.

@w3human
Copy link

w3human commented Aug 5, 2020

could we get this fixed..?

@w3human
Copy link

w3human commented Aug 5, 2020

on mobile.

@w3human
Copy link

w3human commented Aug 5, 2020

function setBoxHeights(element) {
var el = element.clone().css({
height: 'auto',
width: element.width(),
maxHeight: 'none',
overflow: 'hidden'
}).insertAfter(element),
expandedHeight = element.outerHeight(),
cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
defaultHeight = element.data('defaultHeight');

@w3human
Copy link

w3human commented Aug 5, 2020

@Pupinia solved for us. @jedfoster would love it check this in!

@w3human
Copy link

w3human commented Aug 5, 2020

changed el to element, when setting expandedHeight

@jedfoster
Copy link
Owner

@w3human I'd be happy to consider a PR.

@w3human
Copy link

w3human commented Aug 5, 2020

function setBoxHeights(element) {
var el = element.clone().css({
height: 'auto',
width: element.width(),
maxHeight: 'none',
overflow: 'hidden'
}).insertAfter(element);
element.css('height', 'auto');

    var expandedHeight = element.outerHeight(),
    cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\d\.]/g, ''), 10),
    defaultHeight = element.data('defaultHeight');

el.remove();

var collapsedHeight = cssMaxHeight || element.data('collapsedHeight') || defaultHeight;

// Store our measurements.
element.data({
  expandedHeight: expandedHeight,
  maxHeight: cssMaxHeight,
  collapsedHeight: collapsedHeight,
  defaultHeight: defaultHeight,
})
// and disable any `max-height` property set in CSS
.css({
  maxHeight: 'none'
});

}

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

No branches or pull requests

4 participants