We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 14995fa + 7b81ad9 commit c8cf1d4Copy full SHA for c8cf1d4
message-index/index.html
@@ -56,5 +56,20 @@ <h2>The Messages</h2>
56
if (input) {
57
input.setAttribute("placeholder", "🔍 Type here to filter ...");
58
input.focus();
59
+
60
+ //Autofill the search from the URL
61
+ let url = new URL(document.location.href);
62
+ let query = url.searchParams.get('q');
63
+ if(query !== null)
64
+ {
65
+ input.setAttribute('value',query)
66
+ //Move cursor to end
67
+ input.setSelectionRange(query.length,query.length);
68
69
+ //Make sure that the list gets filtered as if the query had been typed manually
70
+ input.dispatchEvent(new KeyboardEvent('keyup'));
71
72
+ }
73
}
74
75
</script>
0 commit comments