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

Save the text entered into an input field into a Python variable

Is there a way to retrieve the text from input fields that do not have a value attribute using Selenium? The issue is that these fields are populated automatically, possibly through JavaScript, upon page load and the text does not appear in the HTML source ...

Dynamic Bootstrap Popover: Creating interactive popups by dynamically attaching events to buttons

I am looking to implement the Bootstrap Popover module to create a confirmation dialog for a delete action. When a <button> is clicked, instead of immediately executing a function, I want a popup to appear allowing the user to either confirm or dismi ...

Using PHP, JavaScript is unable to hide <div> elements

I'm encountering an issue where the div I want to show when an error occurs is not hiding and showing properly using JavaScript. Here is a snippet of my code: <script> function hideerror() { var catdiv = document.getElementById(error); ...

Creating an HTTP request inside an Export Function in a MEANJS application

Initially, I utilized the Yo MeanJs generator to kickstart my project. As a newcomer in the world of MeanJs, things are starting to look quite complex for me. Currently, my MeanJs application is supposed to retrieve data from an HTTP request but, unfortun ...

Unpredictable Behavior of CSS Transition with JS createElement() Function

I'm using JavaScript to create a div element and I'm adding the CSS property transition: .5s linear top; When the user clicks on the element (onmousedown event), it is supposed to smoothly move to the top of the screen and then be deleted using ...

Could there be a coding issue stopping <div class="rating"> from aligning more centrally along the horizontal axis on the screen?

Just wondering, could there be something in my code that's preventing <div class="rating"> from moving closer to the center? And is there a way to make it move closer horizontally? (On a side note, CSS layout and positioning still puzz ...

Learn the process of uploading a file using FormData alongside multer in node js. Experience the issue of receiving undefined in req.file and { } in req.body

Is there a way to successfully upload a file using FormData along with multer in Node.js? I seem to be encountering issues as req.file shows undefined and req.body displays {}. Check out the HTML code snippet below: <input type="file" name=&q ...

Is it possible to track traffic using Alexa or SimilarWeb on a single-page application?

We are currently grappling with the challenge of how to effectively track traffic and user engagement within our classified sites on a single-page application built in angularJS. While we have successfully managed SEO and tracking with Google Analytics, we ...

jQuery dropdown menu button impacts the entire webpage

I created this jQuery code to modify the drop menu elements, but it ended up affecting the entire page. How can I resolve this issue? $(".dropmenuac").on("click",function(){ $(".dropmenulist").css("opacity",& ...

Avoid the sudden change in page content when using Router.Navigate

When the link below is clicked, the current page jumps to the top before proceeding to the next page. <a href="javascript:void(0);" (click)="goToTicket(x.refNo, $event)">{{x.ticketTitle}}</a> component.ts goToTicket(refNo, e) { e.prev ...

Issue with deploying Digital Ocean app: npm ci is not running due to package and package-lock being out of sync

Recently, I've been encountering a fatal error while trying to deploy my app on Digital Ocean. The error message reads: [2022-06-13 07:11:31] npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap ...

Move the aircraft across the display in a lively animation

I need help creating an animation where a plane flies across the screen, exits from the left side, and re-enters from the right side in a continuous loop. How can I achieve this effect to make the plane fly endlessly across the screen? Here is my code: ...

Tips for styling links in Nuxt/Vue based on specific conditions

Struggling with conditional styling in my Nuxt app. I want to change the background color of the active link based on the current page. Using .nuxt-link-exact-active works for styling the active link, but how can I customize it for each page? The links ar ...

Node.js Application with Role-Based Login

I am currently working on implementing role-based administration. When a user is created, the database stores a "1" for Admin or a "2" for a normal user. I want to retrieve this information from the database and display the corresponding start page based o ...

The click() function in jQuery executing only once inside a "for" loop

This is an example of my HTML code: <!DOCTYPE html> <head> <title>Chemist</title> <link href="stylesheet.css" rel="stylesheet"> </head> <body> <h2 id="money"></h2> <table border="1px ...

Is it possible to create a carousel using PHP and MySQL?

Is it really impossible? I'm determined to pull images from a MySQL database and create a carousel similar to the one showcased in this link: . However, my goal is to achieve this using only HTML, CSS, PHP, and MySQL. ...

Traversing JSON Data using Vanilla JavaScript to dynamically fill a specified amount of articles in an HTML page

Here is the code along with my explanation and questions: I'm utilizing myjson.com to create 12 'results'. These results represent 12 clients, each with different sets of data. For instance, Client 1: First Name - James, Address - 1234 Ma ...

pointing out the existing issues with the menu

I am struggling to figure out why I cannot highlight the current menu page on a navigation bar (aside from the fact that I am a complete beginner :-) I have tried using a JQuery function that I found online, but none of them seem to work. Here is the funct ...

Angular 13 does not currently have support for the experimental syntax 'importMeta' activated

Since upgrading to angular 13, I've encountered an issue while attempting to create a worker in the following manner: new Worker(new URL('../path/to/worker', import.meta.url), {type: 'module'}) This code works as expected with "ng ...

Unexpected object returned by the spread operator

Currently, I am utilizing node and specifically using babel-node. "start": "nodemon --exec babel-node --presets es2015 index.js" However, I have encountered an issue with my spread syntax in the following code snippet: export const login = async (parent ...