Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#8747 closed bug (fixed)

Tooltip: Using the track option within dialogs creates JS errors

Reported by: wfsiew Owned by:
Priority: minor Milestone: 1.9.2
Component: ui.tooltip Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:

Description

If there is a content where it is dynamically loaded from ajax into a dialog, and upon the load callback, when the tooltip in the dynamic content is initialized with option track: true, it will cause error in the javascript.

The example code is shown below :

main.html :

<div id="dialog-add" title="Add Form">

<div id="dialog_add_body"></div>

</div>

<input type="button" id="cmd" value="Open" />

javascript in main.html :

$(document).ready(function() {

var popup_dialog_opt = {

autoOpen : false, width : 350, resizable : false, draggable : true, modal : false, stack : true, zIndex : 1000

};

$('#dialog-add').dialog(popup_dialog_opt); $('#cmd').click(show_form);

});

function show_form() {

$('#dialog_add_body').load('form.html', function() {

$('#add-form').tooltip({track: true}); $('#dialog-add').dialog('open');

});

}

form.html :

<form id="add-form" method="post">

<input type="text" name="age" title="enter age" />

</form>

Change History (5)

comment:1 Changed 7 years ago by tj.vantoll

Status: newopen
Summary: Tooltip initialized with track: true upon dynamically loaded in a dialog causes javascript errorTooltip: Using the track option within dialogs creates JS errors

Confirmed and minified - http://jsfiddle.net/tj_vantoll/YaTEk/.

Appears to be just using the track option within a dialog.

comment:2 Changed 7 years ago by Jörn Zaefferer

Probably caused by the dialog putting focus on the input when opening and tooltip missing the blur event or somthing like that.

comment:3 Changed 7 years ago by Jörn Zaefferer

Resolution: fixed
Status: openclosed

Tooltip: Check type on event directly, preventing TypeError when programmatically moving focus to track-toolipped-input. Fixes #8747 - Tooltip: Using the track option within dialogs creates JS errors

Changeset: 98173a3d0ea8e2e6aeb19dda9b232cb65a0684e4

comment:4 Changed 7 years ago by Jörn Zaefferer

Tooltip: Check type on event directly, preventing TypeError when programmatically moving focus to track-toolipped-input. Fixes #8747 - Tooltip: Using the track option within dialogs creates JS errors (cherry picked from commit 98173a3d0ea8e2e6aeb19dda9b232cb65a0684e4)

Changeset: 241c10044d8dadf186a8c29113a954580a44dec8

comment:5 Changed 7 years ago by Scott González

Milestone: 1.10.01.9.2
Note: See TracTickets for help on using tickets.