SearchKit - Save In-place edit when pressing enter
authorcolemanw <coleman@civicrm.org>
Fri, 22 Sep 2023 19:31:45 +0000 (15:31 -0400)
committercolemanw <coleman@civicrm.org>
Fri, 22 Sep 2023 19:31:45 +0000 (15:31 -0400)
ext/search_kit/ang/crmSearchDisplay/crmSearchDisplayEditable.component.js

index 46eed4615d2175b9dac5ebb471571bbbc7b49a5a..e9ddec24a94cd272b2c87a2bad83b19d6c9a83cf 100644 (file)
           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());
           }
         });