datalist-polyfill
Advanced tools
Comparing version 1.23.0 to 1.23.1
{ | ||
"name": "datalist-polyfill", | ||
"description": "A minimal and dependency-free vanilla JavaScript datalist polyfill. Supports all standard's functionality as well as mimics other browsers behavior.", | ||
"version": "1.23.0", | ||
"version": "1.23.1", | ||
"homepage": "https://github.com/mfranzke/datalist-polyfill", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -10,2 +10,8 @@ # Changelog | ||
## [1.23.1] - 2019-01-07 | ||
### Fixed | ||
- JavaScript bug in IE9 and corrected the handling of the browsers towards IE10+ / #GH-50 | ||
## [1.23.0] - 2019-01-05 | ||
@@ -12,0 +18,0 @@ |
@@ -26,7 +26,7 @@ /* | ||
// adapted out of https://gist.github.com/gaboratorium/25f08b76eb82b1e7b91b01a0448f8b1d : | ||
isGteIE11 = Boolean(ua.indexOf('Trident/') !== -1), | ||
isGteIE10 = Boolean(ua.match(/Trident\/[6-7]\./)), | ||
isEDGE = Boolean(ua.indexOf('Edge/') !== -1); | ||
// Let's break here, if it's even already supported ... and not IE11+ or EDGE | ||
if (datalistSupported && !isGteIE11 && !isEDGE) { | ||
// Let's break here, if it's even already supported ... and not IE10+ or EDGE | ||
if (datalistSupported && !isGteIE10 && !isEDGE) { | ||
return false; | ||
@@ -114,4 +114,4 @@ } | ||
// Handling IE11+ & EDGE | ||
if (isGteIE11 || isEDGE) { | ||
// Handling IE10+ & EDGE | ||
if (isGteIE10 || isEDGE) { | ||
// On keypress check for value | ||
@@ -187,3 +187,3 @@ if ( | ||
Check for whether the current option is a valid suggestion and replace its value by | ||
- the current input string, as IE11+ and EDGE don't do substring, but only prefix matching | ||
- the current input string, as IE10+ and EDGE don't do substring, but only prefix matching | ||
- followed by a unique string that should prevent any interferance | ||
@@ -269,4 +269,4 @@ - and the original string, that is still necessary e.g. for sorting within the suggestions list | ||
// Break here for IE11+ & EDGE | ||
if (isGteIE11 || isEDGE) { | ||
// Break here for IE10+ & EDGE | ||
if (isGteIE10 || isEDGE) { | ||
return; | ||
@@ -307,3 +307,3 @@ } | ||
if (isGteIE11 || isEDGE) { | ||
if (isGteIE10 || isEDGE) { | ||
input.addEventListener('input', inputInputListIE); | ||
@@ -316,3 +316,3 @@ } | ||
if (isGteIE11 || isEDGE) { | ||
if (isGteIE10 || isEDGE) { | ||
input.removeEventListener('input', inputInputListIE); | ||
@@ -329,4 +329,4 @@ } | ||
// Break here for IE11+ & EDGE | ||
if (isGteIE11 || isEDGE) { | ||
// Break here for IE10+ & EDGE | ||
if (isGteIE10 || isEDGE) { | ||
return; | ||
@@ -333,0 +333,0 @@ } |
@@ -20,4 +20,4 @@ /* | ||
// adapted out of https://gist.github.com/gaboratorium/25f08b76eb82b1e7b91b01a0448f8b1d : | ||
s=Boolean(-1!==e.indexOf("Trident/")),d=Boolean(-1!==e.indexOf("Edge/")); | ||
// Let's break here, if it's even already supported ... and not IE11+ or EDGE | ||
s=Boolean(e.match(/Trident\/[6-7]\./)),d=Boolean(-1!==e.indexOf("Edge/")); | ||
// Let's break here, if it's even already supported ... and not IE10+ or EDGE | ||
if(t&&!s&&!d)return; | ||
@@ -55,3 +55,3 @@ // .matches polyfill | ||
if("input"===t.tagName.toLowerCase()&&null!==a) | ||
// Handling IE11+ & EDGE | ||
// Handling IE10+ & EDGE | ||
if(s||d) | ||
@@ -82,3 +82,3 @@ // On keypress check for value | ||
Check for whether the current option is a valid suggestion and replace its value by | ||
- the current input string, as IE11+ and EDGE don't do substring, but only prefix matching | ||
- the current input string, as IE10+ and EDGE don't do substring, but only prefix matching | ||
- followed by a unique string that should prevent any interferance | ||
@@ -104,3 +104,3 @@ - and the original string, that is still necessary e.g. for sorting within the suggestions list | ||
var i=t.list.options[0];i.value=i.value} | ||
// Break here for IE11+ & EDGE | ||
// Break here for IE10+ & EDGE | ||
if(!s&&!d){var// Creating the select if there's no instance so far (e.g. because of that it hasn't been handled or it has been dynamically inserted) | ||
@@ -121,3 +121,3 @@ n=a.getElementsByClassName(m)[0]||A(t,a), | ||
// On keypress check all options for that as a substring, save the original value as a data-attribute and preset that inputs value (for sorting) for all option values (probably as well enhanced by a token) | ||
// Break here for IE11+ & EDGE | ||
// Break here for IE10+ & EDGE | ||
if( | ||
@@ -124,0 +124,0 @@ // Binding the focus event - matching the input[list]s happens in the function afterwards |
{ | ||
"name": "datalist-polyfill", | ||
"version": "1.23.0", | ||
"version": "1.23.1", | ||
"description": "A minimal and dependency-free vanilla JavaScript datalist polyfill. Supports all standard's functionality as well as mimics other browsers behavior.", | ||
@@ -5,0 +5,0 @@ "main": "datalist-polyfill.js", |
@@ -27,3 +27,3 @@ [npm]: https://npmjs.com/package/datalist-polyfill 'datalist polyfill – on NPM' | ||
- Lightweight: 6.5 kB of minified JavaScript, around 2.4 kB gzipped | ||
- Lightweight: 6.7 kB of minified JavaScript, around 2.5 kB gzipped | ||
- Fully flexible to change the datalist entries / `<option>`s | ||
@@ -189,3 +189,3 @@ - Supporting: | ||
<td colspan="5" align="center">✔</td> | ||
<td align="center"><a href="https://github.com/mfranzke/datalist-polyfill/issues/49">#GH-49</a></td> | ||
<td align="center">✔ by <a href="https://github.com/mfranzke/datalist-polyfill/issues/49">#GH-49</a></td> | ||
<td colspan="3" align="center">✔</td> | ||
@@ -192,0 +192,0 @@ </tr> |
147308