mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-25 10:17:23 +00:00
Reset integrations search to all if search input is emptied (#15165)
Co-authored-by: Richard Leurs <7275740+EarthlingRich@users.noreply.github.com>
This commit is contained in:
parent
d37ee6c97b
commit
9b24adc108
@ -263,10 +263,13 @@ allComponents.pop(); // remove placeholder element at the end
|
|||||||
var text = $(this).val();
|
var text = $(this).val();
|
||||||
// sanitize input
|
// sanitize input
|
||||||
text = text.replace(/[(\?|\&\{\}\(\))]/gi, '').trim();
|
text = text.replace(/[(\?|\&\{\}\(\))]/gi, '').trim();
|
||||||
if (typeof text === "string" && text.length !== 0) {
|
if (typeof text === "string" && text.length >= 1) {
|
||||||
updateHash('#search/' + text);
|
updateHash('#search/' + text);
|
||||||
applyFilter();
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
updateHash('#all');
|
||||||
|
}
|
||||||
|
applyFilter();
|
||||||
}, 500));
|
}, 500));
|
||||||
|
|
||||||
window.addEventListener('hashchange', applyFilter);
|
window.addEventListener('hashchange', applyFilter);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user