Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
force-list-option
Advanced tools
Forces an input's value to match the value of one of its datalist options, and then some.
Forces an input's value to match the value of one of its datalist options, and then some.
Forces an input's value to match the value of one of its <datalist>
options.
It also provides opt-in functionality via data attributes to improve the default browser behavior for users.
data-constrain
- prevents submission of any form value that does not match a datalist optiondata-autotab
- automatically focus the next focusable element in the DOM when valid data is entereddata-autofill
- whether or not to autofill the input if only one option matches the valuedata-fromstart
- requires that matches are determined from the beginning of the entered inputdata-minlength
- implements a minimum length requirement before autofill'ing the input fieldView a basic demo.
Safari has minimal HTML5 input validation support. Most notably:
<inputs>
<datalist>
elementThis module addresses the "required" bug, preventing the form from submitting with empty "required" inputs.
It will also convert <input>
elements with a <datalist>
into traditional <select>
elements.
Install via npm:
$ npm i force-list-option --save
Requiring the module exposes a factory method that will create an Enforcer
instance for each matching input in the DOM.
For use within a browserified bundle:
var forceListOption = require('force-list-option');
forceListOption(selector, options);
// designed to work well with defaults
forceListOption();
Or include the dist script on the page and call the now-global forceListOption
function:
<script src="path/to/dist/script.js"></script>
<script>
forceListOption(selector, options);
</script>
An instance of the enforcer class is created for each input.
It provides the element-specific functionality as determined by its data attributes.
To use the Enforcer
constructor directly:
var Enforcer = require('force-list-option/lib/enforcer');
var enforcer = new Enforcer(element, options);
Docs can be generated with JSDoc:
$ npm run docs
FAQs
Forces an input's value to match the value of one of its datalist options, and then some.
The npm package force-list-option receives a total of 0 weekly downloads. As such, force-list-option popularity was classified as not popular.
We found that force-list-option demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.