title: HTML5 input autofocus doesn't work
body: <p>I stumble on this case: the autofocus doesn't work while the input field's width is controlled over a button. The focus on click doesn't work either since it triggers the width's animation backward...</p>
  
  <p>I suspect a stupid hierarchy mistake somewhere, so here's a codepen to show you what I did : <a href="https://codepen.io/anon/pen/qPqXdp" rel="nofollow noreferrer">https://codepen.io/anon/pen/qPqXdp</a></p>
  
  <p>Sorry for the basic trouble I'm afraid...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.center {
    margin: 0 auto;
    width: 700px;
  }
  
  .search-wrap {
    position: relative;
  }
  
  .search-button {
    width: 50px;
    height: 50px;
    position: absolute;
    right: 0;
  }
  
  .search-form {
    height: 51px;
    width: 0;
    position: absolute;
    right: 50px;
    top: 0;
    -webkit-transition: width 400ms ease;
    transition: width 400ms ease;
  }
  
  .search-form .search-field {
    height: 100%;
    width: 100%;
  }
  
  .search-button:focus+.search-form {
    width: 650px;
    right: 50px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="center"&gt;
    &lt;div class="search-wrap"&gt;
      &lt;button class="search-button"&gt;?&lt;/button&gt;
      &lt;form class="search-form"&gt;
        &lt;label&gt;
            &lt;input type="search" class="search-field" autofocus/&gt;
          &lt;/label&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>