diff --git a/frappe/public/js/frappe/ui/page.js b/frappe/public/js/frappe/ui/page.js index 0d3d025ddd..b7033ca3b4 100644 --- a/frappe/public/js/frappe/ui/page.js +++ b/frappe/public/js/frappe/ui/page.js @@ -380,14 +380,16 @@ frappe.ui.Page = Class.extend({ * @param {string} selector - CSS Selector of the button to be searched for. By default, it is `li`. * @param {string} label - Label of the button */ - is_in_group_button_dropdown: function(parent, selector, label){ + is_in_group_button_dropdown: function(parent, selector, label) { + if (!selector) selector = 'li'; if (!label || !parent) return false; const result = $(parent).find(`${selector}:contains('${label}')`) .filter(function() { - return $(this).text() === label; + let item = $(this).html(); + return $(item).attr('data-label') === label; }); return result.length > 0; },