From df9b4d4d7c552a718e91a63f90fc17da5125dc4b Mon Sep 17 00:00:00 2001 From: Rodrigo Pan Date: Tue, 8 Oct 2024 17:23:39 +0100 Subject: [PATCH] Fix max-height as the size of the table If the table height is smaller than the avaliable height, the size will be the table size. For example if I filter zero records on serch field. --- features/scrollResize/dataTables.scrollResize.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/features/scrollResize/dataTables.scrollResize.js b/features/scrollResize/dataTables.scrollResize.js index c00ef4e2..2859fe85 100644 --- a/features/scrollResize/dataTables.scrollResize.js +++ b/features/scrollResize/dataTables.scrollResize.js @@ -118,6 +118,9 @@ ScrollResize.prototype = { availableHeight -= offsetTop; availableHeight -= settings.container.height() - (offsetTop + scrollBody.height()); + if (settings.table.height() < availableHeight){ + availableHeight = settings.table.height(); + } $('div.dt-scroll-body', t.container()).css({ maxHeight: availableHeight, height: availableHeight,