<p dir="auto">Hi</p>
<p dir="auto">When resizing the window, i notice that the position of the arrow has been changed from bottom to the center of tooltip/popover.</p>
<p dir="auto">Here is my <a href="http://jsfiddle.net/Arkni/dccpye9a/" rel="nofollow">JSfiddle</a>, and some screenshots taken from JSFiddle<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6888059/4111205/24a6f864-3201-11e4-9c57-5486965331bd.png"><img src="https://cloud.githubusercontent.com/assets/6888059/4111205/24a6f864-3201-11e4-9c57-5486965331bd.png" alt="capture du 2014-09-01 18 51 27" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6888059/4111208/2bf0dc8e-3201-11e4-84a3-1c088452922f.png"><img src="https://cloud.githubusercontent.com/assets/6888059/4111208/2bf0dc8e-3201-11e4-84a3-1c088452922f.png" alt="capture du 2014-09-01 18 51 55" style="max-width: 100%;"></a></p>
<p dir="auto">If this issue is a duplicate, please guide me to the right way!</p>
<p dir="auto">Thanks.</p>
<p dir="auto">PS: i've already searching cross the closed issues and found no solution for my problem.</p>
<p dir="auto">When a tooltip/popover would appear slightly offscreen to the right or left, it's correctly shifted slightly however the arrow ends up appearing in the middle of the popover, rather than at the edge of it like it should.</p>
<p dir="auto">In this case, <code class="notranslate">getViewportAdjustedDelta</code> always returns <code class="notranslate">{top: 0, left: 0}</code> because <code class="notranslate">getCalculatedOffset</code> already made the correction to fit the tip on the page, however there are subsequent "delta.left" tests in <code class="notranslate">applyPlacement</code> to deduce left/right vs top/bottom positioning that will break in top/bottom mode.</p>
<p dir="auto">A fix would be to change the "delta.left" tests with a <code class="notranslate">horizShift</code> test, where <code class="notranslate">horizShift</code> is defined as:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var horizShift = !/right|left/.test(placement);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">horizShift</span> <span class="pl-c1">=</span> <span class="pl-c1">!</span><span class="pl-pds"><span class="pl-c1">/</span>right<span class="pl-c1">|</span>left<span class="pl-c1">/</span></span><span class="pl-kos">.</span><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s1">placement</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">e.g.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var arrowPosition       = horizShift ? 'left'        : 'top'"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">arrowPosition</span>       <span class="pl-c1">=</span> <span class="pl-s1">horizShift</span> ? <span class="pl-s">'left'</span>        : <span class="pl-s">'top'</span></pre></div>