We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Tooltip is not disappearing when clicking and redirecting to a new page .

I have a query regarding syncfusion tooltip.. My issue is, i have a button with tooltip. while hovering on the button the tooltip is working fine. but while clicking on the button, the page is redirected to the next using router link. but the tooltip remains same at the position and it is visible in the nect page too. Looking forward for your help.

Regards

Jiss


3 Replies

SS Sivakumar ShunmugaSundaram Syncfusion Team January 10, 2023 11:47 AM UTC

Hi jismol,


Greetings from Syncfusion support.


We understand that when you are click on a routing element that has a tooltip, the tooltip remains in place even after the page redirects. This issue occurs due to the target element’s maintenance on page navigation.


To resolve this issue, you can use the close method of the Tooltip component during the routing operation as mentioned below. In the shared sample code, we've implemented the Tooltip component on a routing element and closed the Tooltip by using this method.


Refer to the below code snippet.

[HelloWorld.vue]

<li>

          <ejs-tooltip ref="tooltip" content="Tooltip content">

            <router-link to="/about">About</router-link>

          </ejs-tooltip>

        </li>

 


[App.vue]

 

<script>

import { version as vueVer } from "vue";

import { TooltipComponent } from "@syncfusion/ej2-vue-popups";

export default {

  name: "App",

...

  data() {

    return {

      vueVer: vueVer,

    };

  },

  watch: {

    $route(to, from) {

      if (document.getElementsByClassName("e-tooltip")[0] != undefined) {

        document

          .getElementsByClassName("e-tooltip")[0]

          .ej2_instances[0].close();

      }

    },

  },

};

</script>

 


Sample: https://codesandbox.io/s/hardcore-satoshi-2hkbky


Check out the shared sample for your reference.



JI jismol January 16, 2023 09:57 AM UTC

HI  Sivakumar ShunmugaSundaram, 

                        I have got my issue solved. Thank you so much for you response,


Thank you,

Regards,

Jismol



IL Indhumathy Loganathan Syncfusion Team January 19, 2023 09:06 AM UTC

Jismol, We are glad your reported query has been resolved. Please get back to us if you need any further assistance.


Loader.
Up arrow icon