title: Hover issue on div, Horizontal Scroll is coming on last div
body: <p>I have multiple blocks in a row, each block have custom popover div. If the user hovers on last div or second last div in a row then popover is going beyond the window width. I want, if there is no space on the right side for popover, then tile-box class change to tile-box1. Thanks in advance!
  Below is the code pen URL for the reference and i am also attaching the image.</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>.content {
    display: flex;
    flex-wrap: wrap;
  }
  
  .box {
    width: 150px;
    height: 100px;
    position: relative;
    border: 1px solid #ddd;
  }
  
  .box:hover .tile-box {
    display: block;
    ;
  }
  
  .tile-box {
    display: none;
    position: absolute !important;
    z-index: 9;
    top: -6px;
    left: 169px;
    width: 220px;
    height: auto;
    /* padding: 15px; */
    margin-top: 15px;
    position: relative;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 14px 0 rgba(0, 0, 0, 0.06);
    border: solid 1px #e8e8e8;
    /* -webkit-transition: all 0.5s ease;
          -moz-transition: all 0.5s ease;
          -o-transition: all 0.5s ease;
          transition: all 0.5s ease; */
  }
  
  .tile-box {
    padding: 15px !important;
    /* display: block !important; */
  }
  
  .tile-box::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    top: 32px;
    left: 0px;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent white white;
    -webkit-transform-origin: 0 0;
    -webkit-transform: rotate(45deg);
    -ms-transform-origin: 0 0;
    transform-origin: 0 0;
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    -webkit-box-shadow: -3px 2px 2px rgba(0, 0, 0, 0.05);
    box-shadow: -3px 2px 2px rgba(0, 0, 0, 0.05);
  }
  .tile-box1{
  display:block;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="content"&gt;
    &lt;div class="box"&gt;
      &lt;h1&gt;box 1&lt;/h1&gt;
  
      &lt;div class="tile-box"&gt;
        &lt;p&gt;lorem ipsum dolor&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="box"&gt;
      &lt;h1&gt;box 2&lt;/h1&gt;
      &lt;div class="tile-box"&gt;
        &lt;p&gt;lorem ipsum dolor&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="box"&gt;
      &lt;h1&gt;box 3&lt;/h1&gt;
      &lt;div class="tile-box"&gt;
        &lt;p&gt;lorem ipsum dolor&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="box"&gt;
      &lt;h1&gt;box 4&lt;/h1&gt;
      &lt;div class="tile-box"&gt;
        &lt;p&gt;lorem ipsum dolor&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Codepen Url: (<a href="https://codepen.io/uibeast/pen/yLJgJra" rel="nofollow noreferrer">https://codepen.io/uibeast/pen/yLJgJra</a>)</p>
  <p>reference image how it is behaving now<a href="https://i.stack.imgur.com/5gsui.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5gsui.png" alt="enter image description here" /></a></p>