Search and Top Navigation
#3523 closed bug (fixed)
Opened October 28, 2008 09:31PM UTC
Closed August 27, 2010 08:50PM UTC
Last modified November 19, 2010 06:26PM UTC
Dialog: onclick return value ignored
Reported by: | BrianHV | Owned by: | scottgonzalez |
---|---|---|---|
Priority: | major | Milestone: | 1.8.5 |
Component: | ui.dialog | Version: | 1.6rc2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The onclick return value on a link is being overridden when that link is added to a modal dialog.
In the following code sample, clicking the first link correctly does nothing when it's not in a dialog. Clicking the second link places the first into a dialog, at which point the first link causes navigation despite the false return value.
This bug was discovered in 1.6rc2 and confirmed to still be present in trunk.
<html> <body> <script type="text/javascript" language="javascript" src="jquery-1.2.6.js"></script> <script type="text/javascript" language="javascript" src="ui/ui.core.js"></script> <script type="text/javascript" language="javascript" src="ui/ui.dialog.js"></script> <p><a href="nowhere.html" id="brokenlink" onclick="return false;">This link shouldn't do anything, but when it's in a dialog it does.</a></p> <p><a href="#" onclick="$('#brokenlink').dialog({modal: true});">Open dialog</a></p> </body> </html>
Attachments (0)
Change History (10)
Changed October 28, 2008 11:42PM UTC by comment:1
component: | ui.core → ui.dialog |
---|---|
owner: | paul → scott.gonzalez |
Changed December 31, 2008 08:36PM UTC by comment:2
milestone: | TBD → 1.6 |
---|---|
priority: | minor → major |
Changed March 08, 2009 02:40PM UTC by comment:3
milestone: | 1.7 → 1.8 |
---|
Changed March 28, 2009 04:13PM UTC by comment:4
resolution: | → worksforme |
---|---|
status: | new → closed |
This works for me, tested against 1.6rc2 and trunk (1.8pre).
Changed June 22, 2010 06:28PM UTC by comment:5
This behavior is browser-specific, IE8 still behaves this way with jquery-ui 1.8.
This is the slightly modified(to use newer versions of jquery) code to reproduce on IE8
<html> <body> <script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryu i/1.8/themes/base/jquery-ui.css" rel="stylesheet" /> <p><a href="nowhere.html" id="brokenlink" onclick="return false;">This link shouldn't do anything, but when it's in a dialog it does.</a></p> <p><a href="#" onclick="$('#brokenlink').dialog({modal: true});">Open dialog</a></p> </body> </html>
Changed June 22, 2010 06:30PM UTC by comment:6
resolution: | worksforme |
---|---|
status: | closed → reopened |
Changed August 27, 2010 08:33PM UTC by comment:7
summary: | onclick return value ignored in dialog → Dialog: onclick return value ignored |
---|
Changed August 27, 2010 08:50PM UTC by comment:8
milestone: | 1.8 → 1.9 |
---|---|
resolution: | → fixed |
status: | reopened → closed |
Fixed in af9864d.
Changed September 10, 2010 05:24PM UTC by comment:9
milestone: | 1.9 → 1.8.5 |
---|
Changed November 19, 2010 06:26PM UTC by comment:10
Dialog: Don't return true when we don't want to cancel events. Fixes #3523 - Dialog: onclick return value ignored.
Changeset: af9864dcc439bf8d04f4ade248725cc217f66d56