RESOLVED CONFIGURATION CHANGED 37789
<input type="search"> Cancel Button Should Fire an Event
https://bugs.webkit.org/show_bug.cgi?id=37789
Summary <input type="search"> Cancel Button Should Fire an Event
Joseph Pecoraro
Reported 2010-04-18 23:28:18 PDT
Web Developers want to be able to detect when the user pressed the Cancel button in a search input. Currently there is no reliable way to detect this. I think firing an event makes sense. I would suggest firing a bubbling, non-cancelable "cancel" event from the input element. The following would be an example of usage: <input type="search" id="x"> <script> var elem = document.getElementById('x') elem.addEventListener('cancel', function(e) { alert('You Clicked Cancel!'); // e.target would be elem }, false); </script>
Attachments
Alexey Proskuryakov
Comment 1 2010-04-20 16:40:12 PDT
See also: bug 34393.
Kent Tamura
Comment 2 2010-07-22 17:47:49 PDT
Since r63929, WebKit dispatches 'input' event immediately on the cancel button click, and will dispatch 'change' event when the focus is moved from the input field. I think this behavior is enough.
Anne van Kesteren
Comment 3 2023-12-11 06:26:23 PST
Agreed with comment 2.
Note You need to log in before you can comment on or make changes to this bug.