Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
form-subscribe
Advanced tools
A custom element to listen to events that aren't in the hierarchy of bubbling.
form-subscribe
Custom Form ElementSee an example https://jon49.github.io/form-subscribe/.
I use this with my html-form
library. I mainly use it to submit forms based
off of events that happen elsewhere on the page. Sometimes it is nice having the
other functionality too.
The form-subscribe custom form element extends the HTMLFormElement
class and
provides a flexible mechanism for handling form events and executing actions
based on specified configurations. It allows for dynamic event binding,
conditional checks, and debouncing.
<form
is="form-subscribe"
data-event="submit"
data-match="detail: { value: 'valid' }"
data-call="handleFormSubmit">
<!-- Form content goes here -->
</form>
<form
id="my-form"
is="form-subscribe"
data-event="submit"
data-match-not="target: { id: 'my-form' }"
>
<!-- Form content goes here -->
</form>
In this example, the form will request a submit on the "submit" event. Except when itself is submitted.
<form
is="form-subscribe"
data-event="input"
data-match="target: { value: { length: 10} }"
data-call="handleInputChange">
<!-- Form content goes here -->
</form>
This example triggers the handleInputChange
function only when the length of the
input value is 10.
<form
is="form-subscribe"
data-event="input"
data-debounce="500"
data-call="handleInputDebounced">
<!-- Form content goes here -->
</form>
The handleInputDebounced
function will be called with a debounce of 500
milliseconds, preventing rapid consecutive calls.
FAQs
A custom element to listen to events that aren't in the hierarchy of bubbling.
We found that form-subscribe 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.
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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.