Hello
I am using tooltips for various DropDownList, when I place the cursor and choose an item by clicking on it, the tooltip is displayed, then the tooltip is not hidden and stays in place until I move the mouse wheel, sometimes I wait seconds and it disappears, but almost always it is not hidden. I tried the example in the documentation and got the same result. I took screenshots and attach them.
How can I solve this problem?
I also attach screenshots of my code
Thank you so much.
|
onClose(e: any) {
setTimeout(() => {
this.tooltip.close();
}, 250);
}
|
Hello
Deepak R.
The problem persists, I played with the setTimeout values, even so, it does not work, the problem intensifies when I hover pointer over the selected element, for about 2 to 3 seconds (time taken for a user to read the information in the tooltip) then I clicked to choose the item and that is the moment when the tooltip doesn’t disappear.
Do you have any idea about how I can solve it? I would appreciate it.
I apologize for my bad English.
//I share the code with the modifications "component.ts"
|
onClose(e: any) {
var proxy = this;
setTimeout(function () {
proxy.tooltip.close();
}, 400);
} |
I did the modification but the issue is still ongoing
This is the first result on Google when dealing with this issue and a solution was never posted so I'll share what I did to fix it:
during the close event on the Dropdown list you need to get and store the child node that was appended to the body tag during the ngOnViewInit() and remove it.
Then when you open it again, you need to check if that Node value is not null. If it exists, re-append the Node back to the body element.
Trying to do it through the existing Tooltip object was not working as the removeChild() (or remove()) method was triggering the tooltip object to be destroyed. However, by storing the Node we end up with an exact copy of the initial setup that functionally works the same as when the dropdown first renders.
Hi David,
Thanks for your update. Please get back to us if you need any further assistance.
Regards,
Priyanka K
Hi David, can you share a stackblitz link of your solution or full code of yours? Facing the same issue
Hi Nagendra A,
We apologize for any inconvenience you may have experienced. If you are still encountering the issue with the dropdown functionality, we kindly request you to provide us with a runnable sample and a video illustration of the problem. Having a working sample and a visual representation of the issue will greatly assist us in identifying the root cause and offering you an accurate resolution.
Hi, I just saw this so posting a reply now. I made some updates which you can view in the stackblitz link. The best method I found was to use an open and change events:
On the change event I added a clear to the EventHandler, this is so we can remove the tooltip before the dropdown changes/closes and destroys the the tooltip object. This was done prevent errors in the console in the case of clicking outside the tooltip. everything else should be the same from my answer before.
https://stackblitz.com/edit/angular-snprkn-irwpeu?embed=1&file=app.component.ts
Hi David Koenig,
Thank you for promptly addressing Nagendra's query and sharing the details of your solution. We genuinely appreciate your effort and the time you took to provide a comprehensive response.
If you or Nagendra have any further concerns or questions, please don't hesitate to reach out. We're here to assist you.