form-association-polyfill
v2.0.3
Published
HTML5 form attribute polyfill
Downloads
6,245
Readme
form-association-polyfill
HTML5 form attribute polyfill
Install
npm install form-association-polyfill
Usage
Just import library:
import 'form-association-polyfill';
Documentation
Import types
There are several entry points for importing a library:
import FormPolyfill from 'form-association-polyfill'
- similarlyregister-with-shims
;import FormPolyfill from 'form-association-polyfill/standard'
- easy import without polyfills for ie11, register is required;import FormPolyfill from 'form-association-polyfill/with-shims'
- import with shims for ie11, register is required;import FormPolyfill from 'form-association-polyfill/with-polyfills'
- import with polyfill for ie11, register is required;import FormPolyfill from 'form-association-polyfill/register'
- import without polyfills for ie11, auto-register;import FormPolyfill from 'form-association-polyfill/register-with-shims'
- import with shims for ie11, auto-register;import FormPolyfill from 'form-association-polyfill/register-with-polifills'
- import with polyfill for ie11, auto-register.
Differences shims from polyfills you can read in polyshim package.
When directly include the script from the dist
folder to the browser, you can get an FormPolyfill instance via window.FormAssociationPolyfill.default
.
Registration and name of events
When importing a package without register, you need to register it:
import FormPolyfill from 'form-association-polyfill/with-shims';
FormPolyfill.register();
Methods
register()
- register libraryunregister()
- unregister librarysetShim([setClosest[, setEvent]])
- sets shims for non-cross-browser methodssetClosest {Function|null}
- shim forElement.prototype.closest
setEvent {Function|null}
- shim fornew Event
Testing
For tests, you need to install selenium-drivers for browsers. To run tests, use:
npm test
Browsers support
- Internet Explorer 11+
- Other modern browsers
For old browsers use version 1.x.