<h3 dir="auto">What problem does this feature solve?</h3>
<p dir="auto">Because large applications may have MANY custom directives in addition to custom components, it makes sense to treat loading of external definitions similarly.</p>
<p dir="auto">Because the Vue.directive(name, bindOrUpdate) signature exists, we would have to have another call signature, perhaps a 3rd argument?</p>
<h3 dir="auto">What does the proposed API look like?</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Vue.directive(&quot;my-attribute&quot;, null, function(resolve, reject){
  $.getScript(&quot;/vue/directives/my-attribute.directive.js&quot;).then(resolve, reject);
});"><pre class="notranslate"><code class="notranslate">Vue.directive("my-attribute", null, function(resolve, reject){
  $.getScript("/vue/directives/my-attribute.directive.js").then(resolve, reject);
});
</code></pre></div>
<h3 dir="auto">Version</h3>
<p dir="auto">2.5.2</p>
<h3 dir="auto">Reproduction link</h3>
<p dir="auto"><a href="https://codepen.io/spenspazmer/pen/boZeyz?editors=1011" rel="nofollow">https://codepen.io/spenspazmer/pen/boZeyz?editors=1011</a></p>
<h3 dir="auto">Steps to reproduce</h3>
<p dir="auto">Focus one of the letters, press key down/up. Observe the difference in behaviour.</p>
<h3 dir="auto">What is expected?</h3>
<p dir="auto">Focus should be retained when adding/removing components in the list both when pressing up and down.</p>
<h3 dir="auto">What is actually happening?</h3>
<p dir="auto">Pressing key down forces a re-rendering and focus is lost. Pressing key up still works as expected.</p>
<hr>
<p dir="auto">This is related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="266839809" data-permission-text="Title is private" data-url="https://github.com/vuejs/vue/issues/6857" data-hovercard-type="issue" data-hovercard-url="/vuejs/vue/issues/6857/hovercard" href="https://github.com/vuejs/vue/issues/6857">#6857</a> and preventing me from making <a href="https://github.com/Akryum/vue-virtual-scroller/">https://github.com/Akryum/vue-virtual-scroller/</a> work with keyboard navigation.</p>