<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>37789</bug_id>
          
          <creation_ts>2010-04-18 23:28:18 -0700</creation_ts>
          <short_desc>&lt;input type=&quot;search&quot;&gt; Cancel Button Should Fire an Event</short_desc>
          <delta_ts>2023-12-11 06:26:23 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>StevenGBrown</cc>
    
    <cc>tkent</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>213920</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2010-04-18 23:28:18 -0700</bug_when>
    <thetext>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 &quot;cancel&quot; event from the input element.

The following would be an example of usage:

    &lt;input type=&quot;search&quot; id=&quot;x&quot;&gt;
    &lt;script&gt;
    var elem = document.getElementById(&apos;x&apos;)
    elem.addEventListener(&apos;cancel&apos;, function(e) {
        alert(&apos;You Clicked Cancel!&apos;);
        // e.target would be elem
    }, false);
    &lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215061</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-04-20 16:40:12 -0700</bug_when>
    <thetext>See also: bug 34393.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>255116</commentid>
    <comment_count>2</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2010-07-22 17:47:49 -0700</bug_when>
    <thetext>Since r63929, WebKit dispatches &apos;input&apos; event immediately on the cancel button click, and will dispatch &apos;change&apos; event when the focus is moved from the input field.  I think this behavior is enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1998620</commentid>
    <comment_count>3</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-12-11 06:26:23 -0800</bug_when>
    <thetext>Agreed with comment 2.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>