In POS on click of delete button, remove the selected item from the cart (#9428)

diff --git a/erpnext/accounts/page/pos/pos.js b/erpnext/accounts/page/pos/pos.js
index 2bbce60..02d5428 100644
--- a/erpnext/accounts/page/pos/pos.js
+++ b/erpnext/accounts/page/pos/pos.js
@@ -576,11 +576,15 @@
 		})
 
 		$(this.numeric_keypad).find('.numeric-del').click(function(){
-			me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id)
-			me.numeric_val = cstr(flt(me.selected_field.val())).slice(0, -1);
-			me.selected_field.val(me.numeric_val);
-			me.selected_field.trigger("change")
-			// me.render_selected_item()
+			if(me.numeric_id) {
+				me.selected_field = $(me.wrapper).find('.selected-item').find('.' + me.numeric_id)
+				me.numeric_val = cstr(flt(me.selected_field.val())).slice(0, -1);
+				me.selected_field.val(me.numeric_val);
+				me.selected_field.trigger("change")
+			} else {
+				//Remove an item from the cart, if focus is at selected item
+				me.remove_selected_item()
+			}
 		})
 
 		$(this.numeric_keypad).find('.pos-pay').click(function(){
@@ -591,6 +595,14 @@
 		})
 	},
 
+	remove_selected_item: function() {
+		this.remove_item = []
+		idx = $(this.wrapper).find(".pos-selected-item-action").attr("data-idx")
+		this.remove_item.push(idx)
+		this.remove_zero_qty_item()
+		this.update_paid_amount_status(false)
+	},
+
 	render_list_customers: function () {
 		var me = this;
 
diff --git a/erpnext/docs/assets/img/accounts/pos_deleted_item.gif b/erpnext/docs/assets/img/accounts/pos_deleted_item.gif
new file mode 100644
index 0000000..097d3d0
--- /dev/null
+++ b/erpnext/docs/assets/img/accounts/pos_deleted_item.gif
Binary files differ
diff --git a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
index 0c7e591..78d2226 100644
--- a/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
+++ b/erpnext/docs/user/manual/en/accounts/point-of-sale-pos-invoice.md
@@ -47,9 +47,14 @@
 If your product list is very long use the Search field, type the product name
 in Search box.
 
-### Removing an Item
+### Removing an Item from the Cart
 
-Set Qty as zero to remove Item from the POS invoice. There are two ways to remove an Item.
+1. Select row in the cart and clik on delete button in the numeric keypad
+  
+<img class="screenshot" alt="POS Item" src="{{docs_base_url}}/assets/img/accounts/pos_deleted_item.gif">
+
+
+2. Set Qty as zero to remove Item from the POS invoice. There are two ways to remove an Item.
 
   * If Item's Qty is 1, click on a minus sign to make it zero.
 
diff --git a/erpnext/public/js/pos/pos_selected_item.html b/erpnext/public/js/pos/pos_selected_item.html
index 64f8c16..0ed6c71 100644
--- a/erpnext/public/js/pos/pos_selected_item.html
+++ b/erpnext/public/js/pos/pos_selected_item.html
@@ -1,4 +1,4 @@
-<div class="pos-selected-item-action" data-item-code="{%= item_code %}">
+<div class="pos-selected-item-action" data-item-code="{%= item_code %}" data-idx="{%= idx %}">
 	<div class="pos-list-row">
 		<div class="cell">{{ __("Quantity") }}:</div>
 		<input type="tel" class="form-control cell pos-item-qty" value="{%= qty %}"/>