Reset meta text to placeholder if input is cleared

This commit is contained in:
squidfunk
2017-03-23 23:39:19 +01:00
committed by Martin Donath
parent 931465af9f
commit c732082a1c
5 changed files with 16 additions and 8 deletions

View File

@@ -232,8 +232,13 @@ function initialize(config) { // eslint-disable-line func-style
/* Search is open */
if (toggle.checked) {
/* Enter: prevent form submission */
if (ev.key === "Enter") {
if (query === document.activeElement)
ev.preventDefault()
/* Escape: close search */
if (ev.key === "Escape") {
} else if (ev.key === "Escape") {
toggle.checked = false
toggle.dispatchEvent(new CustomEvent("change"))
query.blur()