dual-listbox
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -59,31 +59,31 @@ var clone= require('clone'); | ||
customLaunchers: { | ||
edge14: { | ||
base: 'BrowserStack', | ||
browser: 'edge', | ||
browser_version: '14', | ||
os: 'Windows', | ||
os_version: '10' | ||
}, | ||
// customLaunchers: { | ||
// edge14: { | ||
// base: 'BrowserStack', | ||
// browser: 'edge', | ||
// browser_version: '14', | ||
// os: 'Windows', | ||
// os_version: '10' | ||
// }, | ||
edge15: { | ||
base: 'BrowserStack', | ||
browser: 'edge', | ||
browser_version: '15', | ||
os: 'Windows', | ||
os_version: '10' | ||
}, | ||
// edge15: { | ||
// base: 'BrowserStack', | ||
// browser: 'edge', | ||
// browser_version: '15', | ||
// os: 'Windows', | ||
// os_version: '10' | ||
// }, | ||
ie11: { | ||
base: 'BrowserStack', | ||
browser: 'ie', | ||
browser_version: '11', | ||
os: 'Windows', | ||
os_version: '7' | ||
} | ||
}, | ||
// ie11: { | ||
// base: 'BrowserStack', | ||
// browser: 'ie', | ||
// browser_version: '11', | ||
// os: 'Windows', | ||
// os_version: '7' | ||
// } | ||
// }, | ||
browsers: ['Chrome', 'Firefox', 'edge14', 'edge15', 'ie11'] | ||
// browsers: ['Chrome', 'Firefox'] | ||
// browsers: ['Chrome', 'Firefox', 'edge14', 'edge15', 'ie11'] | ||
browsers: ['Chrome', 'Firefox'] | ||
}); | ||
} |
{ | ||
"name": "dual-listbox", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Dual listbox for multi-select elements", | ||
@@ -5,0 +5,0 @@ "main": "dist/dual-listbox.js", |
@@ -6,2 +6,4 @@ [![Build Status](https://travis-ci.org/maykinmedia/dual-listbox.svg?branch=master)](https://travis-ci.org/maykinmedia/dual-listbox) | ||
[![NPM](https://nodei.co/npm/dual-listbox.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/dual-listbox/) | ||
# Dual Listbox | ||
@@ -8,0 +10,0 @@ |
@@ -96,2 +96,3 @@ const MAIN_BLOCK = 'dual-listbox'; | ||
let items = dualListbox.querySelectorAll(`.${ITEM_ELEMENT}`); | ||
let lowerCaseSearchString = searchString.toLowerCase(); | ||
@@ -102,3 +103,3 @@ for(let i = 0; i < items.length; i++) { | ||
if(searchString) { | ||
if(item.textContent.indexOf(searchString) === -1) { | ||
if(item.textContent.toLowerCase().indexOf(lowerCaseSearchString) === -1) { | ||
item.style.display = 'none'; | ||
@@ -105,0 +106,0 @@ } else { |
@@ -144,13 +144,31 @@ import DualListbox, { DualListbox as DualListbox2 } from '../src/dual-listbox.js'; | ||
it('should be able to seach the items', () => { | ||
it('should be able to search the items', () => { | ||
setFixtures(FIXTURE_FILLED_SELECT); | ||
let query = 'One'; | ||
let dlb = new DualListbox(`.${SELECT_CLASS}`); | ||
dlb.searchLists('One', dlb.dualListbox); | ||
dlb.searchLists(query, dlb.dualListbox); | ||
expect(dlb.available.length).toBe(10); | ||
expect(dlb.selected.length).toBe(0); | ||
for (let i=0;i< dlb.available.length;i++) { | ||
let element = dlb.available[i]; | ||
expect(element.style.display!=="none").toBe(element.innerHTML.toLowerCase().indexOf(query.toLowerCase())>=0); | ||
} | ||
}); | ||
it('should be able to seach the items with no text', () => { | ||
it('should be able to perform case insensitive search', () => { | ||
setFixtures(FIXTURE_FILLED_SELECT); | ||
let query = 'tWO'; | ||
let dlb = new DualListbox(`.${SELECT_CLASS}`); | ||
dlb.searchLists(query, dlb.dualListbox); | ||
expect(dlb.available.length).toBe(10); | ||
expect(dlb.selected.length).toBe(0); | ||
for (let i=0;i< dlb.available.length;i++) { | ||
let element = dlb.available[i]; | ||
expect(element.style.display!=="none").toBe(element.innerHTML.toLowerCase().indexOf(query.toLowerCase())>=0); | ||
} | ||
}); | ||
it('should be able to search the items with no text', () => { | ||
setFixtures(FIXTURE_FILLED_SELECT); | ||
let dlb = new DualListbox(`.${SELECT_CLASS}`); | ||
dlb.searchLists('', dlb.dualListbox); | ||
@@ -157,0 +175,0 @@ expect(dlb.available.length).toBe(10); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70572
849
71