<commit_before>(function(){
  'use strict';

  // event trigger for search filters
  angular.module('cla.directives')
    .directive('searchFilter', ['postal', function (postal) {
      return {
        restrict: 'A',
        link: function(scope, elem) {
          elem.on('blur', function () {
            if (elem.val() !== '') {
              var lbl = elem.attr('name');
              postal.publish({channel: 'SearchFilter', topic: 'search', data: {label: lbl}});
            }
          });
        }
      };
    }]);
})();
<commit_msg>Prevent text search filters submitting forms on enter<commit_after>(function(){
  'use strict';

  // event trigger for search filters
  angular.module('cla.directives')
    .directive('searchFilter', ['postal', function (postal) {
      return {
        restrict: 'A',
        link: function(scope, elem) {
          elem
            .on('blur', function () {
              if (elem.val() !== '') {
                var lbl = elem.attr('name');
                postal.publish({channel: 'SearchFilter', topic: 'search', data: {label: lbl}});
              }
            })
            .on('keydown keypress', function (event) {
              if (event.which === 13) {
                event.preventDefault();
              }
            });
        }
      };
    }]);
})();

{'fraction_non_alphanumeric': 0.16856492027334852, 'fraction_numerical': 0.0015186028853454822, 'mean_word_length': 1.7631027253668763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5656001', 'n_tokens_mistral': 375, 'n_tokens_neox': 367, 'n_words': 82}