From 8f91fd1fef2d34489d56be4b8c830d3d55896384 Mon Sep 17 00:00:00 2001 From: colemanw Date: Fri, 22 Sep 2023 15:31:45 -0400 Subject: [PATCH] SearchKit - Save In-place edit when pressing enter --- .../crmSearchDisplayEditable.component.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext/search_kit/ang/crmSearchDisplay/crmSearchDisplayEditable.component.js b/ext/search_kit/ang/crmSearchDisplay/crmSearchDisplayEditable.component.js index 46eed4615d..e9ddec24a9 100644 --- a/ext/search_kit/ang/crmSearchDisplay/crmSearchDisplayEditable.component.js +++ b/ext/search_kit/ang/crmSearchDisplay/crmSearchDisplayEditable.component.js @@ -32,11 +32,12 @@ nullable: col.edit.nullable }; - $(document).on('keydown.crmSearchDisplayEditable', function(e) { + $(document).on('keydown.crmSearchDisplayEditable', (e) => { if (e.key === 'Escape') { - $scope.$apply(function() { - ctrl.cancel(); - }); + $scope.$apply(() => ctrl.cancel()); + } + else if (e.key === 'Enter') { + $scope.$apply(() => ctrl.save()); } }); -- 2.25.1