Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 41edf74

Browse filesBrowse files
committed
Update input rules with regex to allow space
1 parent 84eea7b commit 41edf74
Copy full SHA for 41edf74

File tree

2 files changed

+2
-2
lines changed
Filter options

2 files changed

+2
-2
lines changed

‎js/components/DropdownSearchFilter.js

Copy file name to clipboardExpand all lines: js/components/DropdownSearchFilter.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
class DropdownSearchFilter {
88
constructor() {
9-
this.inputRules = new RegExp('^[a-zA-Z]([a-zA-Z\-\s]){2,30}$', 'g');
109
this.$searchFilters = document.querySelectorAll('.search-filters ul');
1110
this.$closeBtn = document.querySelectorAll('.search-filters li .btn-close');
11+
this.inputRules = new RegExp(/^[\w+|\s]{2,30}$/, 'gmi');
1212

1313
this.init();
1414
}

‎js/components/MainSearchBar.js

Copy file name to clipboardExpand all lines: js/components/MainSearchBar.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MainSearchBar {
99
this.$form = document.querySelector('#main_search');
1010
this.$input = document.querySelector('#recipes_search');
1111
this.$closeBtn = document.querySelector('#main_search .btn-close');
12-
this.inputRules = new RegExp('^[a-zA-Z]([a-zA-Z\-\s]){2,30}$', 'g');
12+
this.inputRules = new RegExp(/^[\w+|\s]{2,30}$/, 'gmi');
1313

1414
this.init();
1515
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.