Skip to content

Commit

Permalink
Allow numbers in search. Add Prettier settings file.
Browse files Browse the repository at this point in the history
  • Loading branch information
codecodeio committed Jun 14, 2024
1 parent bd2ecf7 commit bedbb6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 800
}
4 changes: 2 additions & 2 deletions cigaradvisor/blocks/search-results/search-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function handleSearch(searchValue, block, limit) {
const wrapper = block.querySelector('.article-teaser-wrapper');
const searchSummary = document.createElement('p');
searchSummary.classList.add('search-summary');
if (searchValue.length < 3 || !searchValue.match(/[a-z]/i)) {
if (searchValue.length < 3 || !searchValue.match(/[a-z0-9]/i)) {
searchSummary.innerHTML = 'Please enter at least three (3) characters to search.';
wrapper.replaceChildren(searchSummary);
return;
Expand All @@ -23,7 +23,7 @@ async function handleSearch(searchValue, block, limit) {
if (results.length === 0) {
const noResults = document.createElement('p');
noResults.classList.add('no-results');
noResults.textContent = 'Sorry, we couldn\'t find the information you requested!';
noResults.textContent = "Sorry, we couldn't find the information you requested!";
wrapper.replaceChildren(searchSummary);
wrapper.append(noResults);
block.classList.remove('loading');
Expand Down

0 comments on commit bedbb6f

Please sign in to comment.