<commit_before>export default function initFilter() {
	const filterableItems = document.querySelectorAll('.js-filterable__item');
	const filterableForm = document.getElementById('js-filterable__form');
	const filterableField = document.getElementById('js-filterable__field');
	const filterableCounter = document.getElementById('js-filterable__counter');
	let counter = filterableItems.length;

	if (filterableItems === null || filterableField === null) {
		return false;
	}

	filterableForm.submit = false;

	function filterBy() {
		const filterTerm = filterableField.value.toLowerCase().trim();

		for (let i = 0; i < filterableItems.length; i += 1) {
			if (filterTerm !== '' && filterableItems[i].textContent.toLowerCase().indexOf(filterTerm) === -1) {
				if (!filterableItems[i].hasAttribute('hidden')) {
					filterableItems[i].setAttribute('hidden', 'hidden');
					counter -= 1;
				}
			} else if (filterableItems[i].hasAttribute('hidden')) {
				filterableItems[i].removeAttribute('hidden');
				counter += 1;
			}
		}

		if (filterableCounter !== null) {
			filterableCounter.textContent = counter;
		}
	}

	return filterableField.addEventListener(
		'input',
		filterBy,
		false,
	);
}<commit_msg>Fix filter submission override<commit_after>export default function initFilter() {
	const filterableItems = document.querySelectorAll('.js-filterable__item');
	const filterableForm = document.getElementById('js-filterable__form');
	const filterableField = document.getElementById('js-filterable__field');
	const filterableCounter = document.getElementById('js-filterable__counter');
	let counter = filterableItems.length;

	if (filterableItems === null || filterableField === null) {
		return false;
	}

	filterableForm.onsubmit = false;

	function filterBy() {
		const filterTerm = filterableField.value.toLowerCase().trim();

		for (let i = 0; i < filterableItems.length; i += 1) {
			if (filterTerm !== '' && filterableItems[i].textContent.toLowerCase().indexOf(filterTerm) === -1) {
				if (!filterableItems[i].hasAttribute('hidden')) {
					filterableItems[i].setAttribute('hidden', 'hidden');
					counter -= 1;
				}
			} else if (filterableItems[i].hasAttribute('hidden')) {
				filterableItems[i].removeAttribute('hidden');
				counter += 1;
			}
		}

		if (filterableCounter !== null) {
			filterableCounter.textContent = counter;
		}
	}

	return filterableField.addEventListener(
		'input',
		filterBy,
		false,
	);
}
{'fraction_non_alphanumeric': 0.14279852277390234, 'fraction_numerical': 0.004103405826836274, 'mean_word_length': 4.91747572815534, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2990055', 'n_tokens_mistral': 796, 'n_tokens_neox': 712, 'n_words': 137}