Index: src/wp-admin/css/widgets.css
===================================================================
--- src/wp-admin/css/widgets.css	(revision 38709)
+++ src/wp-admin/css/widgets.css	(working copy)
@@ -332,9 +332,13 @@
 }
 
 .editwidget {
-	margin: 0 auto;
+	max-width: 40em; /* about 80 characters, for readability */
 }
 
+.editwidget select {
+	width: 100%;
+}
+
 .editwidget .widget-inside {
 	display: block;
 	padding: 0 15px;
Index: src/wp-admin/widgets.php
===================================================================
--- src/wp-admin/widgets.php	(revision 38709)
+++ src/wp-admin/widgets.php	(working copy)
@@ -181,12 +181,32 @@
 	$sidebars_widgets[$sidebar_id] = $sidebar;
 
 	// Remove old position.
-	if ( !isset($_POST['delete_widget']) ) {
+	if ( ! isset( $_POST['delete_widget'] ) ) {
+		// Detect if the widget is registered, in case remove from the sidebar in editing.
+		global $wp_widget_factory;
+		foreach ( $sidebars_widgets[ $_POST['sidebar'] ] as $key => $sb ) {
+			$notfound = false;
+			foreach ( $wp_widget_factory->widgets as $widget_obj => $class ) {
+				// Get the base id of the widget.
+				$sb_pieces = explode( '-', $sb );
+				array_pop( $sb_pieces );
+				$widget_base_id = implode( '-', $sb_pieces );
+				// Have we found that widget?
+				if ( $widget_base_id === $class->id_base ) {
+					$notfound = true;
+				}
+			}
+			// In case the widget is not found, we remove it from the db.
+			if ( false === $notfound ) {
+				unset( $sidebars_widgets[ $_POST['sidebar'] ][ $key ] );
+			}
+		}
+		array_values( $sidebars_widgets );
 		foreach ( $sidebars_widgets as $key => $sb ) {
-			if ( is_array($sb) )
-				$sidebars_widgets[$key] = array_diff( $sb, array($widget_id) );
+			if ( is_array( $sb ) )
+			$sidebars_widgets[ $key ] = array_diff( $sb, array( $widget_id ) );
 		}
-		array_splice( $sidebars_widgets[$sidebar_id], $position, 0, $widget_id );
+		array_splice( $sidebars_widgets[ $sidebar_id ], $position, 0, $widget_id );
 	}
 
 	wp_set_sidebars_widgets($sidebars_widgets);
@@ -259,13 +279,12 @@
 	$id_base = isset($control['id_base']) ? $control['id_base'] : $control['id'];
 
 	// Show the widget form.
-	$width = ' style="width:' . max($control['width'], 350) . 'px"';
 	$key = isset($_GET['key']) ? (int) $_GET['key'] : 0;
 
 	require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
 	<div class="wrap">
 	<h1><?php echo esc_html( $title ); ?></h1>
-	<div class="editwidget"<?php echo $width; ?>>
+	<div class="editwidget">
 	<h2><?php printf( __( 'Widget %s' ), $name ); ?></h2>
 
 	<form action="widgets.php" method="post">
@@ -279,7 +298,7 @@
 
 	<p class="describe"><?php _e('Select both the sidebar for this widget and the position of the widget in that sidebar.'); ?></p>
 	<div class="widget-position">
-	<table class="widefat"><thead><tr><th><?php _e('Sidebar'); ?></th><th><?php _e('Position'); ?></th></tr></thead><tbody>
+	<table class="widefat"><thead><tr><th><?php _e( 'Sidebar' ); ?></th><th><?php _e( 'Widget position' ); ?></th></tr></thead><tbody>
 <?php
 	foreach ( $wp_registered_sidebars as $sbname => $sbvalue ) {
 		echo "\t\t<tr><td><label><input type='radio' name='sidebar' value='" . esc_attr($sbname) . "'" . checked( $sbname, $sidebar, false ) . " /> $sbvalue[name]</label></td><td>";
@@ -286,21 +305,43 @@
 		if ( 'wp_inactive_widgets' == $sbname || 'orphaned_widgets' == substr( $sbname, 0, 16 ) ) {
 			echo '&nbsp;';
 		} else {
-			if ( !isset($sidebars_widgets[$sbname]) || !is_array($sidebars_widgets[$sbname]) ) {
+			if ( ! isset( $sidebars_widgets[ $sbname ] ) || ! is_array( $sidebars_widgets[ $sbname ] ) ) {
 				$j = 1;
-				$sidebars_widgets[$sbname] = array();
+				$sidebars_widgets[ $sbname ] = array();
 			} else {
-				$j = count($sidebars_widgets[$sbname]);
-				if ( isset($_GET['addnew']) || !in_array($widget_id, $sidebars_widgets[$sbname], true) )
+				$j = count( $sidebars_widgets[ $sbname ] );
+				// When adding a new widget or the edited widget is not in this sidebar, add one more cycle to the loop below.
+				if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
 					$j++;
+				}
 			}
 			$selected = '';
+			$index = $widget_new_position = 0;
 			echo "\t\t<select name='{$sbname}_position'>\n";
 			echo "\t\t<option value=''>" . __('&mdash; Select &mdash;') . "</option>\n";
+			/*
+			 * When adding a new widget or the edited widget is not in this sidebar, this loop runs
+			 * one cycle more than the actual widgets count to build an empty option in the select.
+			 */
 			for ( $i = 1; $i <= $j; $i++ ) {
-				if ( in_array($widget_id, $sidebars_widgets[$sbname], true) )
-					$selected = selected( $i, $key + 1, false );
-				echo "\t\t<option value='$i'$selected> $i </option>\n";
+				// Get the ID of the widget in the loop. Set it to false when running the additional loop cycle.
+				$sidebar_widget_id = isset( $sidebars_widgets[ $sbname ][ $index ] ) ? $sidebars_widgets[ $sbname ][ $index ] : false;
+				// If the widget is not avalaible o not exist add an available position option
+				if ( empty( $sidebar_widget_id ) || isset( $wp_registered_widgets[ $sidebar_widget_id ]['name'] ) ) {
+					$widget_new_position++;
+					// If the widget ID is set then get the widget name otherwise set a name for the empty option.
+					$select_option_content = $sidebar_widget_id ? sprintf( __( '(currently set to: %s)' ), $wp_registered_widgets[ $sidebar_widget_id ]['name'] ) : esc_html_x( '(available position)', 'widget' );
+
+					if ( in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) {
+						$selected = selected( $i, $key + 1, false );
+					}
+
+					echo "\t\t<option value='$widget_new_position'$selected>$widget_new_position $select_option_content</option>\n";
+				} else {
+					// Add a new option because this code is executed only when the widget is removed from the check above
+					$j++;
+				}
+				$index++;
 			}
 			echo "\t\t</select>\n";
 		}
