Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
yet-another-autocomplete
Advanced tools
This is the simplest possible autocomplete implementation. It handles just few things for you:
Enter
or by clicking itEscape
keypressAll the rest you can do on your own 😉
yarn add yet-another-autocomplete
import Autocomplete from 'yet-another-autocomplete'
// Optionally require basic simple styles for the dialog.
// You can skip this step and just write your own styles in a way you like.
require('yet-another-autocomplete/style')
const items = ['Apple', 'Banana']
const autocomplete = new Autocomplete(this.el.querySelector('input[type="text"]'), {
query: (term, setter) => {
// Filter results based on `term`.
// You can also do AJAX requests and set results asynchronously.
// Call the `setter` with an array of `{text, value}` objects.
const results = items
.filter(i => i.text.toLowerCase().match(term.toLowerCase()))
.map(result => ({text: result, value: result}))
setter(results)
},
onSelect: (value) => {
// You receive a selected result in the same `{text, value}` form.
// Do something with the selected value here...
},
disableCaching: true // By default caching results by term is enabled, and can be disabled by this flag
})
// Destroy when not needed anymore.
// This will remove an autocomplete box from the DOM and unassign all related event listeners.
autocomplete.destroy()
FAQs
Yet another autocomplete for your browser JS
We found that yet-another-autocomplete demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.