Merge pull request #5178 from node-red/4926-fix-palette-filter-safari

Do not use css display when counting filtered palette nodes
pull/5181/head
Nick O'Leary 2025-06-16 14:13:06 +01:00 committed by GitHub
commit bcdd2858d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -80,7 +80,7 @@ RED.palette = (function() {
getNodeCount: function (visibleOnly) {
const nodes = catDiv.find(".red-ui-palette-node")
if (visibleOnly) {
return nodes.filter(function() { return $(this).css('display') !== 'none'}).length
return nodes.filter(function() { return $(this).attr("data-filter") !== "true"}).length
} else {
return nodes.length
}
@ -572,8 +572,10 @@ RED.palette = (function() {
var currentLabel = $(el).attr("data-palette-label");
var type = $(el).attr("data-palette-type");
if (val === "" || re.test(type) || re.test(currentLabel)) {
$(el).attr("data-filter", null)
$(this).show();
} else {
$(el).attr("data-filter", "true")
$(this).hide();
}
});