From 847c963c1ded6c9a05f79e3c1d006df4a7ccda5b Mon Sep 17 00:00:00 2001 From: SandyDatatables Date: Fri, 27 Aug 2021 13:48:21 +0000 Subject: [PATCH 1/3] fix: Fix issue with search box moving to the left when fuzzysearch toggleSmart enabled 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 7885a94..7911570 100644 --- a/features/fuzzySearch/dataTables.fuzzySearch.js +++ b/features/fuzzySearch/dataTables.fuzzySearch.js @@ -254,9 +254,10 @@ fuzzy =$('') .insertAfter(input) .css(toggleCSS); - input.css({ - 'padding-right': '30px' - }); + input.css({ + 'padding-right': '30px' + }); + $(input.parent()).css('right', '-33px').css('position', 'relative'); label = $('
Search Type
').css({'padding-bottom': '0.5em', 'font-size': '0.8em'}) tooltip = $('
') .css({ From 139ca488ff82bbd3e2a5f1aa59a13452cc943878 Mon Sep 17 00:00:00 2001 From: SandyDatatables Date: Fri, 27 Aug 2021 14:01:11 +0000 Subject: [PATCH 2/3] 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)) }) From 3f220cb0e68685bdd2f9c495257e54253322ce69 Mon Sep 17 00:00:00 2001 From: SandyDatatables Date: Fri, 27 Aug 2021 14:36:51 +0000 Subject: [PATCH 3/3] fix: Fix fuzzysearch tooltip alignment issue with small screens Jira Issue DD-2128 --- features/fuzzySearch/dataTables.fuzzySearch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/fuzzySearch/dataTables.fuzzySearch.js b/features/fuzzySearch/dataTables.fuzzySearch.js index a490894..e0edc8c 100644 --- a/features/fuzzySearch/dataTables.fuzzySearch.js +++ b/features/fuzzySearch/dataTables.fuzzySearch.js @@ -383,7 +383,7 @@ tooltip .insertAfter(toggle) .on('mouseleave', removeToolTip); - tooltip.css('left', input.offset().left - tooltip.offset().left) + tooltip.css('left', input.position().left + 3) exact.on('click', (event) => highlightButton(exact, event)); fuzzy.on('click', (event) => highlightButton(fuzzy, event)); }) @@ -395,7 +395,7 @@ tooltip .insertAfter(toggle) .on('mouseleave', removeToolTip); - tooltip.css('left', input.offset().left - tooltip.offset().left) + tooltip.css('left', input.position().left + 3) exact.on('click', (event) => highlightButton(exact, event)) fuzzy.on('click', (event) => highlightButton(fuzzy, event)) })