diff --git a/source/components/index.html b/source/components/index.html
index ec18adc3a91..a81f9750a51 100644
--- a/source/components/index.html
+++ b/source/components/index.html
@@ -61,7 +61,7 @@ Support for these components is provided by the Home Assistant community.
@@ -265,9 +265,11 @@ allComponents.pop(); // remove placeholder element at the end
$('.component-search input').keyup(debounce(function() {
var text = $(this).val();
// sanitize input
- text = text.replace(/[(\?|\&\{\}\(\))]/gi, '');
- updateHash('#search/' + text);
- applyFilter();
+ text = text.replace(/[(\?|\&\{\}\(\))]/gi, '').trim();
+ if (typeof text === "string" && text.length !== 0) {
+ updateHash('#search/' + text);
+ applyFilter();
+ }
}, 500));
window.addEventListener('hashchange', applyFilter);