List out of window
May be this will help some guys. TODO: Manage "$(window).resize()"
` // Open/close $(document).on('click.nice_select', '.nice-select', function(event) { var $dropdown = $(this); var $list = $dropdown.find('.list'); // NEW LINE
$('.nice-select').not($dropdown).removeClass('open');
$dropdown.toggleClass('open');
if ($dropdown.hasClass('open')) {
$dropdown.find('.option');
$dropdown.find('.focus').removeClass('focus');
$dropdown.find('.selected').addClass('focus');
// NEW LINES
if($list.attr('style')) $list.removeAttr('style'); // Reset
var maxHeight = ($(window).innerHeight() - $list.offset().top - 60); // "60" => spacing
if($list.height() > maxHeight)
{
$list.css({
'height': maxHeight,
'overflow-y': 'auto',
'-webkit-overflow-scrolling': 'touch'
});
}
} else {
$dropdown.focus();
if($list.attr('style')) $list.removeAttr('style'); // NEW LINE
}
});
`
Would you mind to send a PR ?
Hello,
Sorry, I don't understand what you mean..?..
Manuel Piton Interactive developer +32 497 31 97 27 [callto:+32497319727] • [email protected] [mailto:[email protected]]
"Easy does it" is not part of our mindset. [email protected] [mailto:[email protected]] • www.redsky-thirty.be [http://www.redsky-thirty.be/] Chemin des Vallées de Roux, 31 - B-1457 Walhain-Saint-Paul
Le 07/10/2018 08:28:58, miagile [email protected] a écrit : Would you mind to send a PR ? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub [https://github.com/hernansartorio/jquery-nice-select/issues/80#issuecomment-427629488], or mute the thread [https://github.com/notifications/unsubscribe-auth/ALF8_-BU51yKXCAicpA6VT2rB4FKjHbvks5uiZ8mgaJpZM4XFwba].