Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Data toggle modal inside data toggle tooltip


Hi,
I was trying to use both functionality at the same time: Here is my example html code:

<div class="symbol symbol-35px symbol-circle" data-bs-toggle="tooltip" data-placement="top" aria-label="Henüz Atanmamış" data-bs-original-title="Henüz Atanmamış" data-kt-initialized="1">
<span class="symbol-label fw-bolder l-height0 bg-transparent border cursor-pointer" data-bs-toggle="modal" data-bs-target="#responsibleAssignmentModal1">
<i class="las la-hourglass-half fs-1"></i>
</span>
</div>


In desktop screens it's working but in small screens when I click on the div it show both tooltip and modal. Is there a way to disable tooltip in this case?

Tried to hide tooltip but it's not working. Maybe you guide me?

var tooltipElements = document.querySelectorAll('.symbol[data-bs-toggle="tooltip"]');
var modalElements = document.querySelectorAll('.symbol[data-bs-toggle="modal"]');

modalElements.forEach(function (modalElement, index) {
modalElement.addEventListener('show.bs.modal', function () {
var tooltip = bootstrap.Tooltip.getInstance(tooltipElements[index]);
if (tooltip) {
tooltip.hide();
}
});
});


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (2)


Sorry, in my first post html converted directly to symbol, because KTDevComm uses same classes.
Here is HTML:


<div class="symbol symbol-35px symbol-circle" data-bs-toggle="tooltip" data-placement="top" aria-label="Hen&uuml;z Atanmam&Auml;&plusmn;&Aring;&#159;" data-bs-original-title="Hen&uuml;z Atanmam&Auml;&plusmn;&Aring;&#159;" data-kt-initialized="1">
<span class="symbol-label fw-bolder l-height0 bg-transparent border cursor-pointer" data-bs-toggle="modal" data-bs-target="#responsibleAssignmentModal1">
<i class="las la-hourglass-half fs-1"></i>
</span>
</div>



Hi,

Can you try to assign the tooltip to an inner element and use Bootstrap responsive util class to hide it for mobile ?


<div class="symbol">
<div data-bs-toggle="tooltip" title="some text" class="d-none d-lg-block">
<span class="symbol-label">
... Desktop version
</span>
</div>

<div class="d-block d-lg-none">
<span class="symbol-label">
...Mobile version
</span>
</div>
</div>


Regards


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(