<?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>195819</bug_id>
          
          <creation_ts>2019-03-15 13:53:08 -0700</creation_ts>
          <short_desc>REGRESSION (r242173): Programmatically focusing &lt;select&gt; after user dismisses it does not open it again and leaves view in bad state</short_desc>
          <delta_ts>2025-09-29 14:30:42 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>WebKit Local Build</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 12</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, PlatformOnly, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>195118</dependson>
    
    <dependson>196272</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Daniel Bates">dbates</reporter>
          <assigned_to name="Wenson Hsieh">wenson_hsieh</assigned_to>
          <cc>akeerthi</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1517110</commentid>
    <comment_count>0</comment_count>
      <attachid>364836</attachid>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-03-15 13:53:08 -0700</bug_when>
    <thetext>Created attachment 364836
Test

Seen on iPad.

Steps to reproduce:

The following assume you have a hardware keyboard attached.

1. Open the attached test case.
2. Follow the instructions.

The test fails following &lt;https://trac.webkit.org/changeset/242173/&gt; (bug #195118). Prior to the change, it passed.

Notes:

When the bug occurs the WKContentView is *NOT* the first responder. If you then tap somewhere on page we make the WKContentView first responder and the popover opens!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1517111</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-15 13:53:25 -0700</bug_when>
    <thetext>&lt;rdar://problem/48937037&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1517112</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-03-15 13:53:25 -0700</bug_when>
    <thetext>&lt;rdar://problem/48937038&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1517156</commentid>
    <comment_count>3</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-03-15 14:54:27 -0700</bug_when>
    <thetext>This is because of my new first responder restriction when determining whether to allow programmatic focus to present an input view.

Namely, after r242173, when WKContentView is not first responder, we’ll no longer allow programmatic focus to show an input view (this is to prevent web content from stealing focus away from page chrome using programmatic focus).

Need to think more about what our policy should be in this scenario...any change that would prevent users from being able to switch tabs or type in the unified field and navigate away in this case is a non-starter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1521610</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Bates">dbates</who>
    <bug_when>2019-03-26 21:26:13 -0700</bug_when>
    <thetext>I will fix this issue in the patch for bug #196272. Keeping this bug open to remind myself to add a test for this bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>364836</attachid>
            <date>2019-03-15 13:53:08 -0700</date>
            <delta_ts>2019-03-15 13:53:08 -0700</delta_ts>
            <desc>Test</desc>
            <filename>programmatic-focus-select-after-user-blur.html</filename>
            <type>text/html</type>
            <size>583</size>
            <attacher name="Daniel Bates">dbates</attacher>
            
              <data encoding="base64">PHNjcmlwdD4KZnVuY3Rpb24gcnVuVGVzdCgpCnsKICAgIGxvZygiV2lsbCBmb2N1cyA8c2VsZWN0
PiBpbiAxIHNlYy4uLiIpOwogICAgd2luZG93LnNldFRpbWVvdXQoKCkgPT4gewogICAgICAgIGRv
Y3VtZW50LnF1ZXJ5U2VsZWN0b3IoInNlbGVjdCIpLmZvY3VzKCk7CiAgICAgICAgbG9nKCJDYWxs
ZWQgZm9jdXMuIik7CiAgICAgICAgbG9nKCJEaWQgdGhlIHBvcG92ZXIgb3Blbj8gSWYgc28sIHRo
ZSB0ZXN0IFBBU1NFRC4gT3RoZXJ3aXNlLCBpdCBGQUlMRUQuIik7CiAgICB9KTsKfQoKZnVuY3Rp
b24gbG9nKG1lc3NhZ2UpCnsKICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjb25zb2xlIiku
YXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUobWVzc2FnZSArICJcbiIpKTsKfQo8
L3NjcmlwdD4KPHA+VGFwIHRoZSAmbHQ7c2VsZWN0Jmd0OyB0aGVuIHRhcCBzb21ld2hlcmUgaW4g
dGhlIGJhY2tncm91bmQuPC9wPgo8c2VsZWN0IG9uYmx1cj0icnVuVGVzdCgpIj48b3B0aW9uPkZp
cnN0PC9vcHRpb24+PG9wdGlvbj5TZWNvbmQ8L29wdGlvbj48L3NlbGVjdD4KPHByZSBpZD0iY29u
c29sZSI+PC9wcmU+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>