From 139ca488ff82bbd3e2a5f1aa59a13452cc943878 Mon Sep 17 00:00:00 2001 From: SandyDatatables Date: Fri, 27 Aug 2021 14:01:11 +0000 Subject: [PATCH] fix: Fix issue with fuzzy search tooltip alignment Jira Issue DD-2128 --- features/fuzzySearch/dataTables.fuzzySearch.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/fuzzySearch/dataTables.fuzzySearch.js b/features/fuzzySearch/dataTables.fuzzySearch.js index 7911570..a490894 100644 --- a/features/fuzzySearch/dataTables.fuzzySearch.js +++ b/features/fuzzySearch/dataTables.fuzzySearch.js @@ -262,7 +262,6 @@ tooltip = $('
') .css({ 'position': 'absolute', - 'right': '0px', 'top': '2em', 'background': 'white', 'border-radius': '4px', @@ -272,9 +271,9 @@ 'box-shadow': '4px 4px 4px rgba(0, 0, 0, 0.5)', 'color': 'white', 'transition': 'opacity 0.25s', - 'z-index': '30001' + 'z-index': '30001', + 'width': input.outerWidth() - 3, }) - .width(input.outerWidth() - 3) .append(label).append(exact).append(fuzzy); } @@ -384,6 +383,7 @@ tooltip .insertAfter(toggle) .on('mouseleave', removeToolTip); + tooltip.css('left', input.offset().left - tooltip.offset().left) exact.on('click', (event) => highlightButton(exact, event)); fuzzy.on('click', (event) => highlightButton(fuzzy, event)); }) @@ -395,6 +395,7 @@ tooltip .insertAfter(toggle) .on('mouseleave', removeToolTip); + tooltip.css('left', input.offset().left - tooltip.offset().left) exact.on('click', (event) => highlightButton(exact, event)) fuzzy.on('click', (event) => highlightButton(fuzzy, event)) })