Is Popper.js malfunctioning when bootstrap CSS is included?

Encountered a rather peculiar issue where Popper.js and Tooltip.js refuse to function properly when Bootstrap CSS is being utilized.

Here is the code snippet used for testing:

<script src="https://unpkg.com/popper.js/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/tooltip.js/dist/umd/tooltip.min.js"></script>

<span id="test-tooltip" data-tooltip="Testing tooltips!">Hover over me, I dare you.</span>

 <script>
  document.addEventListener('DOMContentLoaded', function() {
    var referenceElement = document.getElementById("test-tooltip");
    var instance = new Tooltip(referenceElement, {
      title: referenceElement.getAttribute('data-tooltip'),
      placement: "bottom",
    });
  });
</script>

There's additional CSS involved, but it's quite lengthy, so I'll keep that towards the end.

If Bootstrap is included anywhere, the entire functionality ceases. No tooltips appear upon hovering.

<link rel="stylesheet" href="CSS/bootstrap.css">

The latest version of bootstrap was tried, along with a few older versions as well.

Below is the CSS responsible for styling the tooltips:

.popper,
.tooltip {
  position: absolute;
  background: rgb(75, 75, 75);
  color: white;
  min-width: 80px;
  border-radius: 3px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  padding: 12px;
  text-align: center;
}
.popper .popper__arrow,
.tooltip .tooltip-arrow {
  width: 0;
  height: 0;
  border-style: solid;
  position: absolute;
  margin: 5px;
}

.tooltip .tooltip-arrow,
.popper .popper__arrow {
  border-color: rgb(75, 75, 75);
}
/* Remaining CSS properties omitted for brevity */

Any insights on why this unusual behavior might be occurring? Attempted solutions include:

  • Removing all tooltip-related elements from bootstrap.css
  • Importing bootstrap before/after Popper.js in the code
  • Incorporating custom CSS into bootstrap.css

Various other troubleshooting steps were undertaken, although specifics have slipped my mind amidst trying to resolve this issue.

Answer №1

After reviewing your code, I can confirm that it is functioning smoothly. The only issue seems to be related to the opacity settings of the tooltip. To resolve this problem, consider adding the following CSS snippet:

.tooltip[aria-hidden="false"]{
  opacity:1;
}

You can also view a live example on JSFiddle through this link

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

difficulty arises with the background image specified as "img/download.jpg" in the URL declaration

I'm encountering an issue where when I try to import an image in CSS, nothing happens. I have checked the file path (address) and everything seems correct in the code. For example, this is what I have written in my style sheet: * { background-image: ...

Why is my node.js react app failing to detect the index.html file?

Take a look at the app here: git repository The issue I'm facing is that index.html doesn't seem to be properly linked, resulting in: 1) The website not being responsive for mobile devices 2) Lack of a favicon https://i.sstatic.net/l4hHJ.png ...

Upon selecting multiple checkboxes, corresponding form fields will be displayed based on shared attributes

When multiple checkboxes are selected by the user, corresponding form fields should appear based on the checkboxes. For example, if both flight and hotel checkboxes are checked, then the full name and last name fields should be displayed while other fields ...

Breaking up and Substituting text within Angular 8's HTML structure

When I retrieve data from a REST api, I need to split the name parameter at '2330' and insert a line break. For example, if the name is: ABCD 2330 This is My Name, I want the output on my screen to appear as: ABCD 2330 This is My Name // this par ...

Equalizing Grid Heights in Twitter Bootstrap

I need to achieve the same height for my sections using Bootstrap 4 but I want only the content <div class="content"> to be enlarged, not the header and footer. section { background: #ccc; border: 1px solid #000 } header { background: red; ...

Did I accidentally overlook a tag for this stylish stripe mesh Gradient design?

I've been attempting to replicate the striped animated Gradient mesh using whatamesh.vercel.app. I've set up the JS file, inserted all the gist code into it, and placed everything in the correct locations, but unfortunately, it's not functio ...

Using the section :export in the SCSS :root declaration

In the file test.module.scss, I store all my variables for colors, typography, and more. I want to be able to use these variables in my react components. However, the file starts with :root to define the variables: :root{ --color-white: #fff; --color-b ...

Is it acceptable to include a heading element within a label element?

Would it be acceptable to include other elements such as <h1> <h2> <b> within <label> elements, or is it preferable to use style instead? <label for="B"><b>like this</b></label> <label for=" ...

Contains a D3 (version 3.4) edge bundle chart along with a convenient update button for loading fresh datasets

I am looking to update my D3 (v3.4) edge bundling chart with a new dataset when a user clicks an 'update' button. Specifically, I want the chart to display data from the data2.json file instead of data1.json. Although I have started creating an u ...

Inserting lines into the text, creating a visually appealing layout

Can a notepad design be created using CSS only? Is it feasible to include lines between text lines without using underscores? I want it to look like this example but with minimal spacing between lines and no manual insertion of span tags since the text wi ...

Can the minimum length be automatically filled between two elements?

I'm struggling to find a way to adjust the spacing of the "auto filling in" dots to ensure a minimum length. Sometimes, on smaller screens, there are only one or two dots visible between items. Is there a way to set a minimum length for the dots in th ...

How can I trigger a function once ng-show has finished executing?

I have an HTML table and buttons with the attribute ng-show=some_property. What I am trying to achieve is: I want Button1 to reveal a table containing field1, and I would like to change the focus directly from Button1 to field1. However, I am encounterin ...

A guide to changing the height of a column in Bootstrap

I've utilized Bootstrap to create features in the HTML, and I'm attempting to make each box's height consistent. Check out a screenshot of the boxes here #hr-1 { width: 100px; margin-left: 20%; } #features { background-color: #f0 ...

Contrast between using tbody td:nth-of-type(3){ border-bottom-color: transparent; } and tr.noborder td{ border-bottom: transparent; } within CSS styling

First Situation: h1{ text-align: center; } td{ width: 100px; height: 100px; border-right: 1px solid gray; border-bottom: 1px solid gray; } table{ margin: 0px auto 0px auto; } tbody td:nth-of-type(3){ border-right-color: transparent; } tbody tr:nt ...

Is it possible to alter the HTML structure using JavaScript?

Looking to shift the positions of 2 divs using JavaScript DOM manipulation, all without altering the HTML. <div class="div1"> this should move downwards</div> <div class="div2"> while this should move upwards</div&g ...

Leveraging PHP to execute a Python script

I am currently working on integrating a PHP code with a Python script (ring.py) and I need some help resolving an issue. <?php echo '<p>Hello World</p>'; $output = exec('python ring.py'); ?> The python scrip ...

I seem to be having trouble getting my style to work properly with Material UI's makeStyles

I am experiencing an issue with Material-UI makeStyles not working properly. I am trying to apply my CSS style but it doesn't seem to be taking effect. I suspect that Bootstrap or MaterialTable might be causing this problem. While Bootstrap4 works fin ...

Eliminate extraneous space with the clearfix:after pseudo-element

Could use some help figuring out how to remove the unwanted whitespace caused by clearing the float (specifically after the tabs). Any suggestions on how to fix this issue? Take a look at the code snippet below (jsfiddle): /* Clearfix */ .clearfix:af ...

Customizing jQuery-UI's Select-Menu Widget with CSS

I am facing some challenges with setting CSS properties for jQuery-UI widgets, especially the SelectMenu. Basic styling like margins does not seem to work, and I am struggling to assign different CSS styles to two separate SelectMenu widgets. Here is a sim ...

Should the max-height transition be set from 0 to automatically adjust or to none?

I'm dealing with an element that has a max-height of 0, and I want to smoothly transition it to either no max-height, auto, or none; essentially allowing it to expand based on the number of elements inside. I prefer not to use JavaScript or flex at th ...