From e0a8211605d45855d3edbfab770470ecf2f94e08 Mon Sep 17 00:00:00 2001 From: Matthias Perret Date: Thu, 20 Aug 2020 00:08:37 +0200 Subject: [PATCH] fixes searchInAttribute config searching null attribute --- package.json | 2 +- src/ListFilter.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6d9dba5..0519350 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mp3000mp/list-filter", - "version": "0.1.3", + "version": "0.1.4", "description": "Simple library with no dependencies that help you to hide html list items that do not match a pattern", "main": "/src/ListFilter.js", "files": [ diff --git a/src/ListFilter.js b/src/ListFilter.js index 67a161b..3cddb14 100644 --- a/src/ListFilter.js +++ b/src/ListFilter.js @@ -71,7 +71,7 @@ let ListFilter = function (trigger, list, options) { if(options.searchInAttribute === false){ str = li.textContent; }else{ - str = li.getAttribute(options.searchInAttribute); + str = li.getAttribute(options.searchInAttribute) || ''; } if(!options.caseSensitive){ return str.toLowerCase();