diff --git a/assets/js/common.js b/assets/js/common.js index 022a753..8b94fb5 100644 --- a/assets/js/common.js +++ b/assets/js/common.js @@ -394,6 +394,12 @@ } if (e.key === 'Escape' && isInput) { + if (active.type === 'search' || active.hasAttribute('data-example-search') || active.hasAttribute('data-change-search')) { + if (active.value !== '') { + active.value = ''; + active.dispatchEvent(new Event('input', { bubbles: true })); + } + } active.blur(); } } catch (err) {} diff --git a/examples.html b/examples.html index 154e05c..9f9a7aa 100644 --- a/examples.html +++ b/examples.html @@ -71,14 +71,14 @@