diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index b9ae976e58f2c59bb42bd585283a060910524490..79b0c63b387b2892bcf389ebabb384c88c5072af 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -49,6 +49,7 @@
 #include "llfloaterpay.h"
 #include "llfloaterworldmap.h"
 #include "llgiveinventory.h"
+#include "llinventorybridge.h"
 #include "llinventorymodel.h"	// for gInventory.findCategoryUUIDForType
 #include "llinventorypanel.h"
 #include "llimview.h"			// for gIMMgr
@@ -443,17 +444,27 @@ namespace action_give_inventory
 	}
 
 	/**
-	 * Checks My Inventory visibility.
+	 * @return active inventory panel, or NULL if there's no such panel
 	 */
-	static bool is_give_inventory_acceptable()
+	static LLInventoryPanel* get_active_inventory_panel()
 	{
 		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
 		if (!active_panel)
 		{
 			active_panel = get_outfit_editor_inventory_panel();
-			if (!active_panel) return false;
 		}
 
+		return active_panel;
+	}
+
+	/**
+	 * Checks My Inventory visibility.
+	 */
+	static bool is_give_inventory_acceptable()
+	{
+		LLInventoryPanel* active_panel = get_active_inventory_panel();
+		if (!active_panel) return false;
+
 		// check selection in the panel
 		const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
 		if (inventory_selected_uuids.empty()) return false; // nothing selected
@@ -543,12 +554,8 @@ namespace action_give_inventory
 			return;
 		}
 
-		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
-		if (!active_panel)
-		{
-			active_panel = get_outfit_editor_inventory_panel();
-			if (!active_panel) return;
-		}
+		LLInventoryPanel* active_panel = get_active_inventory_panel();
+		if (!active_panel) return;
 
 		const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
 		if (inventory_selected_uuids.empty())
@@ -632,12 +639,8 @@ namespace action_give_inventory
 		llassert(avatar_names.size() == avatar_uuids.size());
 
 
-		LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
-		if (!active_panel)
-		{
-			active_panel = get_outfit_editor_inventory_panel();
-			if (!active_panel) return;
-		}
+		LLInventoryPanel* active_panel = get_active_inventory_panel();
+		if (!active_panel) return;
 
 		const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList();
 		if (inventory_selected_uuids.empty())
@@ -672,6 +675,53 @@ void LLAvatarActions::shareWithAvatars()
 	LLNotificationsUtil::add("ShareNotification");
 }
 
+
+// static
+bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NULL*/)
+{
+	using namespace action_give_inventory;
+
+	if (!inv_panel)
+	{
+		LLInventoryPanel* active_panel = get_active_inventory_panel();
+		if (!active_panel) return false;
+		inv_panel = active_panel;
+	}
+
+	// check selection in the panel
+	LLFolderView* root_folder = inv_panel->getRootFolder();
+	const uuid_set_t inventory_selected_uuids = root_folder->getSelectionList();
+	if (inventory_selected_uuids.empty()) return false; // nothing selected
+
+	bool can_share = true;
+	uuid_set_t::const_iterator it = inventory_selected_uuids.begin();
+	const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end();
+	for (; it != it_end; ++it)
+	{
+		LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
+		// any category can be offered.
+		if (inv_cat)
+		{
+			continue;
+		}
+
+		// check if inventory item can be given
+		LLFolderViewItem* item = root_folder->getItemByID(*it);
+		if (!item) return false;
+		LLInvFVBridge* bridge = dynamic_cast<LLInvFVBridge*>(item->getListener());
+		if (bridge && bridge->canShare())
+		{
+			continue;
+		}
+
+		// there are neither item nor category in inventory
+		can_share = false;
+		break;
+	}
+
+	return can_share;
+}
+
 // static
 void LLAvatarActions::toggleBlock(const LLUUID& id)
 {
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index 6313ae075931c75d8216223ff27521736891d9f5..44bd3778da2e8ee4893aa965cf7dd5ab0aadd19d 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -34,6 +34,8 @@
 #include <string>
 #include <vector>
 
+class LLInventoryPanel;
+
 /**
  * Friend-related actions (add, remove, offer teleport, etc)
  */
@@ -183,6 +185,15 @@ class LLAvatarActions
 	 */
 	static bool canOfferTeleport(const uuid_vec_t& ids);
 
+	/**
+	 * Checks whether all items selected in the given inventory panel can be shared
+	 *
+	 * @param inv_panel Inventory panel to get selection from. If NULL, the active inventory panel is used.
+	 *
+	 * @return false if the selected items cannot be shared or the active inventory panel cannot be obtained
+	 */
+	static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL);
+
 private:
 	static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
 	static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 23e96c22fa841681db02024977fcfd1d41aad7f2..1e585ece23c5f6a354b9005f87912f8c8f975856 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -311,18 +311,17 @@ bool LLSidepanelInventory::canShare()
 	LLPanelMainInventory* panel_main_inventory =
 		mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
 
-	LLFolderView* root_folder =
-		panel_main_inventory->getActivePanel()->getRootFolder();
-
-	LLFolderViewItem* current_item = root_folder->hasVisibleChildren()
-		? root_folder->getCurSelectedItem()
-		: NULL;
+	if (!panel_main_inventory)
+	{
+		llwarns << "Failed to get the main inventory panel" << llendl;
+		return false;
+	}
 
-	LLInvFVBridge* bridge = current_item
-		? dynamic_cast <LLInvFVBridge*> (current_item->getListener())
-		: NULL;
+	LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel();
+	// Avoid flicker in the Recent tab while inventory is being loaded.
+	if (!active_panel->getRootFolder()->hasVisibleChildren()) return false;
 
-	return bridge ? bridge->canShare() : false;
+	return LLAvatarActions::canShareSelectedItems(active_panel);
 }
 
 LLInventoryItem *LLSidepanelInventory::getSelectedItem()