jQWidgets Forums
jQuery UI Widgets › Forums › Dialogs and Notifications › Tooltip, Notification, Popover › closeOnClick not working when element's button clicked twice
Tagged: click, close, closeOnClick, jqxTooltip, Tooltip
This topic contains 2 replies, has 2 voices, and was last updated by donovanh 11 years, 4 months ago.
-
Author
-
I seem to be having trouble with the closeOnClick behavior. It works fine in most circumstances. However, if the button which has the tooltip is clicked again while the tooltip is still showing, the closeOnClick behavior appears to break. I have seen your tooltip fiddle (http://jsfiddle.net/jqwidgets/jxhQR/), and the fiddle does not have this problem. Perhaps the following information could explain why mine does?
(1) I’m using jqW 2.8.3 and jQuery 1.10.2.
(2) The behavior appears across different browsers.
(3) When the button is clicked a second time while the tooltip is active, a diagnostic handler on the opening event is executed, but not one on the open event.
(4) Once the button has been clicked the second time, the tooltip not only refuses to close when the tooltip body is clicked, but also refuses to be closed by an event handler on the body tag which closes all tooltips. (This handler was verified working in normal circumstances.) Diagnostic handlers are not executed on either the close or the closing events in this case.
(5) In the second-click-while-open scenario, the tooltip will still close if (and apparently _only_ if) I click a different element which has a tool tip.
(6) The element to which the tooltip is attached is a dynamically generated element.Here is the code that creates the elements in question, then attaches buttons and tooltips:
$linesToAnnotate.each(function(index){ var src; var button; if ($(this).hasClass('question')){ src = 'question.png'; } else if ($(this).hasClass('tip')){ src = 'tip.png'; } else{ // must be warning src = 'warning.png'; } button = '<img class="tut_icon" src="images/' + src + '"/>'; $(this).append(button); }); $('.tut_icon').each(function(index){ $(this).jqxButton({width:16, height:16, theme:'gp'}); $(this).jqxTooltip({trigger: 'click', theme: 'gp', width: 350, autoHide: false, position: 'right', opacity: 1, content:$notes.eq(index).html()}); });
I would be grateful for any help you can give with this puzzling problem.
Respectfully,
DonovanHello Donovan,
We recommend you to update to the latest version of jQWidgets (3.1.0). If the issue persists, please contact us again and post a complete example, which we may test locally.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Interesting…I didn’t see any fixes in the release notes that I thought looked relevant to this issue, but upgrading to 3.1.0 did indeed fix the problem. Thanks a bunch.
Donovan
-
AuthorPosts
You must be logged in to reply to this topic.