Browse Source

On blur exit search if input vaalue is empty

Yuin Chien 6 years ago
parent
commit
673d4c9b03
2 changed files with 16 additions and 0 deletions
  1. 8 0
      docs/index.html
  2. 8 0
      examples/index.html

+ 8 - 0
docs/index.html

@@ -128,6 +128,14 @@
 
 			}
 
+			filterInput.onblur = function ( event ) {
+
+				if(filterInput.value === '') {
+					panel.classList.remove('searchFocused');
+				}
+
+			}
+
 			exitSearchButton.onclick = function( event ) {
 
 				filterInput.value = '';

+ 8 - 0
examples/index.html

@@ -202,6 +202,14 @@
 
 		}
 
+		filterInput.onblur = function ( event ) {
+
+			if(filterInput.value === '') {
+				panel.classList.remove('searchFocused');
+			}
+
+		}
+
 		exitSearchButton.onclick = function( event ) {
 
 			filterInput.value = '';