Make a div with absolute positioning overflow outside of a div with relative positioning that is scrollable

I am facing an issue with two columns positioned side by side. The right column contains a tooltip that overflows to the left on hover. Both columns are scrollable and relatively positioned to allow the tooltip to follow the scroll. However, the tooltip is partially hidden by the left column. I want it to overflow past the edge as if it were positioned above the left column.

Here is a mockup of how it currently looks: https://jsfiddle.net/yL9ugkvj/35

JS

class Columns extends React.Component {  
  render() {
    return (
      <div className='flex'>
         <div className='left'>
           <div>
             <div></div>
           </div>
         </div>
         <div className='right'>
           <div>
             <div id="header">
               <p className="label">
                 label
                 <div className='tooltip'>
                   <p>tooltip</p>
                 </div>
               </p>
             </div>
           </div>
         </div>
      </div>
    )
  }
}

ReactDOM.render(<Columns />, document.querySelector("#app"))

CSS

body {
  background: #20262E;
  padding: 20px;
  font-family: Helvetica;
}

#app {
  background: #fff;
  border-radius: 4px;
  padding: 20px;
  transition: all 0.2s;
}

div.flex {
  display: grid;
  grid-template-columns: 50% 50%;
}

div.left::-webkit-scrollbar {
  display: none;
}

div.left {
  display: flex;
  flex-direction: column;
  top: 0;
  height: 92vh;
  overflow-y: scroll;
  -ms-overflow-style: none;
  scrollbar-width: none;
  justify-content: flex-start;
  z-index: 0;
}

div.right::-webkit-scrollbar {
  display: none;
}


div.right {
  position: relative;
  display: flex;
  flex-direction: column;
  top: 0;
  height: 92vh;
  overflow-y: scroll;
  overflow-x: visible;
  -ms-overflow-style: none;
  scrollbar-width: none;
  justify-content: flex-start;
  z-index: 1;
}

div.flex>div>div {
  border: 2px solid #E0E0E0;
  background-color: #F5F4F2;
  border-radius: 15px;
  margin: 10px;
  padding: 10px 40px;
  min-width: 80%;
}

#header {
  display: flex;
  position: relative;
  border: none;
  margin: 0px;
  padding: 0px;
  overflow: visible;
}

div.tooltip {
  display: none;
  position: absolute;
  border-radius: 12px;
  background: #E8E6DE;
  box-shadow: 0px 4px 11.9px 8px rgba(0, 0, 0, 0.25);
  z-index: 3;
  padding: 25px;
  width: 35vw;
  right: 100%;
}

p.label:hover>div.tooltip {
  font-size: 16px;
  display: inline-block;
  padding: 10px 25px;
}

I've tried various solutions like adjusting z-index and setting the width manually, but none have worked. It used to work before I made each column independently scrollable, but now with relative positioning, it's causing issues.

Answer №1

Eliminating the overflow-y: scroll; from the parent element .right appeared to successfully resolve the issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Curating personalized designs within a content management system

Currently, I am developing a SaaS platform that will feature customized styles for user accounts. The current method involves using YAML to create unique stylesheets for each account. However, as the number of accounts increases, I am starting to question ...

Unusual behavior being exhibited by the background in an HTML5 canvas

I have an 800 by 100 image for the background and I'm trying to extract sections from it (like a sprite sheet) in order to create a background. I believe this method is efficient and allows me to experiment and learn how to generate backgrounds in the ...

Display information from an array in checkboxes. If the same data appears in another array, the corresponding checkbox in React will be automatically checked

I currently have two arrays. The first array, let's call it arr1, contains multiple objects such as [{"Name":"Mr.X"},{"Name":"Mr.Y"},{"Name":"Mr.Z"}]. The second array, named arr2, holds a few values like [{"Name":"Mr.Z"}]. My goal is to display all ...

Enhancing image search functionality through dynamic HTML updates

I need help figuring out how to update the link address for profile pictures on my NHL stats website. Currently, I am using a script to append the image to the body, but I don't know how to properly add the player ID ({{p1_ID}}) to the link and includ ...

Tips for automatically setting Material UI checkbox list as checked by default

Is there a way to have all items checked by default when the component first renders? I've tried using the defaultChecked property from the docs, but setting it to true didn't work. The checked property also does not seem to have any effect. Yo ...

continuously repeating css text animation

How do I create an animation loop that slides infinitely, repeating non-stop in full screen without breaking at 'hello5'? I want to display 3 rows of the same item from my items array. Not sure which CSS is causing the issue. The result I am loo ...

Exploring Font-Awesome 5: Using CSS Pseudo-elements to Mirror or Rotate Icons

I am utilizing CSS pseudo elements to display icons (jsfiddle) body { font-family: Arial; font-size: 13px; } a { text-decoration: none; color: #515151; } a:before { font-family: "Font Awesome 5 Free"; content: "\f07a"; di ...

Creating a FusionCharts time series with a sleek transparent background

Currently, I am attempting to achieve a transparent background for a time-series chart created with FusionCharts. Despite trying the standard attributes that usually work on other chart types and even hardcoding a background color, none of these seem to af ...

Using JavaScript to Access PHP Files

Would like to understand the process of calling a php file (test.php) from either "x:" or "y:" in the code below. var example1 = { x: ['giraffes', 'orangutans', 'monkeys'], y: [20, 14, 23], name: 'Most read', ...

Service in Angular2+ that broadcasts notifications to multiple components and aggregates results for evaluation

My objective is to develop a service that, when invoked, triggers an event and waits for subscribers to return data. Once all subscribers have responded to the event, the component that initiated the service call can proceed with their feedback. I explore ...

Retrieve the information from a website and display it on the current webpage using an ajax request

Is there a way to insert parsed HTML content into my webpage using just a link from another page? I'm attempting to use an AJAX call, but I keep receiving an error. Below is the code I've written, and the browser doesn't seem to be the issue ...

Error Encountered (TypeError): Unable to access attributes of undefined (attempting to read 'appendChild')

I have been working on creating a choropleth Map of AntV using React.js with functional components. This is the code snippet for my chart: import DataSet from '@antv/data-set'; import { Chart } from '@antv/g2'; const CustomerByRegion = ...

Troubleshooting the Issue of Angular Model Not Refreshing in Angular.js

Running into an issue with my directive where the model isn't updating as expected. Here's a snippet of my HTML code: <div class="text-area-container"> <textarea ng-model="chatText" ng-keyup="updateCount(chatText)">< ...

`Accessing information within a nested JSON array``

I'm currently parsing through the JSON data below. While I can extract the id and name fields without any issues, I am encountering a problem when trying to access json.templates[i].dailyemails.length, as it always returns 0. Below is the structure o ...

Sending a variable to a template in AngularJS

I am looking for a way to pass a variable or text to a template in order to display the value within my template. While browsing through resources, I found an example on jsFiddle that demonstrates this functionality using ng-repeat. However, I am curious ...

Define the starting value for Framer Motion's useCycle by taking into account the width of the screen

With the help of Framer Motion's useCycle hook, I am able to toggle the visibility of my sidebar. The desired behavior is to have the sidebar open by default on desktop (window width > 480px) and closed by default on mobile devices. To achieve thi ...

Enhance your website's accessibility by using JavaScript to allow the down and up arrow keys to function

Thank you for taking the time to read this, any feedback is greatly appreciated. The current script on my website is only partially functional (click "i" in the bottom right corner). Currently, the script will focus on the first link AFTER pressing the T ...

Creating a variable in JavaScript

In my HTML body, I have set up a global variable named index with the value <%var index = 0;%>. This allows me to access it throughout the code. I'm trying to assign the value of $(this).val() to <% index %>, but I can't seem to get ...

"Exploring the Intersection of Meteor, NPM Packages, and Fiber Callbacks

I am currently utilizing request and cheerio to extract specific content, particularly a quote, from a website. Here is the code snippet ( server.js ) : q = new Mongo.Collection('quotelist'); postList = new Mongo.Collection('quotes&apos ...

Navigating through property objects in Vue: accessing individual elements

I am a newcomer to Vue and after reviewing other questions on this platform, I am struggling to figure out how to pass an object to a child component and reference individual elements within that object. My goal is to have access to all elements of the obj ...