Skip to content

Instantly share code, notes, and snippets.

@stevemayhew
Created December 28, 2011 19:27
Show Gist options
  • Select an option

  • Save stevemayhew/1529284 to your computer and use it in GitHub Desktop.

Select an option

Save stevemayhew/1529284 to your computer and use it in GitHub Desktop.
Demo for Selectmenu Destory Bug
<!DOCTYPE html>
<html>
<head>
<title>Demo Selectmenu Issue w/Label</title>
<link rel="Stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css" type="text/css" />
<link rel="Stylesheet" href="http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.css" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/ui.selectmenu.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a[href="#create"]').click(function(event){
$('select.select_demo').selectmenu();
event.preventDefault();
});
$('a[href="#destroy"]').click(function(event){
$('select.select_demo').selectmenu('destroy');
event.preventDefault();
});
});
</script>
</head>
<body>
<h1>Here's an un-labeled selectmenu</h1>
<select class="select_demo">
<option>Apples</option>
<option>Oranges</option>
<option>Bananas</option>
</select>
<h1>Controls</h1>
<p>
<ul>
<li><a href="#create">Create Selectmenu</a></li>
<li><a href="#destroy">Destroy Selectmenu</a></li>
</ul>
</p>
</body>
</html>
@stevemayhew
Copy link
Author

This demos the bug in selectmenu destroy. Click create to create the select menu, then destroy to destroy it. You see it errors out and fails to complete the destroy. Error is at Selectmenu line 309.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment