Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ie9-oninput-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ie9-oninput-polyfill - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

15

ie9-oninput-polyfill.js
(function (d) {
if (navigator.userAgent.indexOf('MSIE 9') === -1) return;
var elements = [], values = [];
d.addEventListener('selectionchange', function() {
var actEl = d.activeElement;
var el = d.activeElement;
if (actEl.tagName === 'TEXTAREA' || (actEl.tagName === 'INPUT' && actEl.type === 'text')) {
var idx = elements.indexOf(actEl), el = elements[idx] || elements.push(actEl);
if (el.value !== values[idx]) {
values[idx] = el.value;
var ev = d.createEvent('CustomEvent');
ev.initCustomEvent('input', true, true, {});
el.dispatchEvent(ev);
}
if (el.tagName === 'TEXTAREA' || (el.tagName === 'INPUT' && el.type === 'text')) {
var ev = d.createEvent('CustomEvent');
ev.initCustomEvent('input', true, true, {});
el.dispatchEvent(ev);
}
});
})(document);

@@ -1,1 +0,1 @@

(function(n){if(navigator.userAgent.indexOf("MSIE 9")!==-1){var t=[],i=[];n.addEventListener("selectionchange",function(){var u=n.activeElement,f,e;(u.tagName==="TEXTAREA"||u.tagName==="INPUT"&&u.type==="text")&&(f=t.indexOf(u),e=t[f]||t.push(u),e.value!==i[f]&&(i[f]=e.value,r=n.createEvent("CustomEvent"),r.initCustomEvent("input",!0,!0,{}),e.dispatchEvent(r)))})}})(document);
!function(a){navigator.userAgent.indexOf("MSIE 9")!==-1&&a.addEventListener("selectionchange",function(){var b=a.activeElement;if("TEXTAREA"===b.tagName||"INPUT"===b.tagName&&"text"===b.type){var c=a.createEvent("CustomEvent");c.initCustomEvent("input",!0,!0,{}),b.dispatchEvent(c)}})}(document);
{
"name": "ie9-oninput-polyfill",
"version": "1.1.0",
"version": "1.1.1",
"description": "Forces IE9 to trigger the INPUT event when the user deletes/cuts text from the input - making the event works as it should (and as it does in all the modern browsers)",
"main": "ie9-oninput-polyfill.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {

@@ -10,0 +7,0 @@ "type": "git",

@@ -7,6 +7,23 @@ # IE9 oninput (input event) polyfill

`<script src="ie9-oninput-polyfill.js"></script>`
```html
<script src="ie9-oninput-polyfill.js"></script>
```
You can even use the conditional tags:
`<!--[if IE 9]><script src="ie9-oninput-polyfill.js"></script><![endif]-->`
```html
<!--[if IE 9]><script src="ie9-oninput-polyfill.js"></script><![endif]-->
```
## NPM
You can install it from NPM also:
```shell
npm install --save ie9-oninput-polyfill
```
Then, if using some bundler like webpack/browserify, you only need to import it:
```javascript
require('ie9-oninput-polyfill');
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc