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

element-internals-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

element-internals-polyfill - npm Package Compare versions

Comparing version 0.1.42 to 0.1.43

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

### [0.1.43](https://github.com/calebdwilliams/element-internals-polyfill/compare/v0.1.42...v0.1.43) (2021-07-30)
### Bug Fixes
* polyfill manages onsubmit attributes set before form is initialized ([0e333a2](https://github.com/calebdwilliams/element-internals-polyfill/commit/0e333a27c8b7acd383ecf513a598f51b9eef7534))
### [0.1.42](https://github.com/calebdwilliams/element-internals-polyfill/compare/v0.1.41...v0.1.42) (2021-07-25)

@@ -7,0 +14,0 @@

15

dist/index.js

@@ -17,2 +17,3 @@ (function () {

const documentFragmentMap = new WeakMap();
const onSubmitMap = new WeakMap();

@@ -61,3 +62,4 @@ const observerConfig$1 = { attributes: true, attributeFilter: ['disabled'] };

const formSubmitCallback = (event) => {
const elements = formElementsMap.get(event.target);
const form = event.target;
const elements = formElementsMap.get(form);
if (elements.size) {

@@ -76,2 +78,9 @@ const nodes = Array.from(elements);

}
else if (onSubmitMap.get(form)) {
const callback = onSubmitMap.get(form);
const canceled = callback.call(form, event);
if (canceled === false) {
event.preventDefault();
}
}
}

@@ -91,2 +100,6 @@ };

if (form) {
if (form.onsubmit) {
onSubmitMap.set(form, form.onsubmit.bind(form));
form.onsubmit = null;
}
const formElements = formElementsMap.get(form);

@@ -93,0 +106,0 @@ if (formElements) {

@@ -33,1 +33,3 @@ /**

export declare const documentFragmentMap: WeakMap<DocumentFragment, MutationObserver>;
/** Save references to the form onsubmit if present */
export declare const onSubmitMap: WeakMap<HTMLFormElement, Function>;

2

package.json
{
"name": "element-internals-polyfill",
"version": "0.1.42",
"version": "0.1.43",
"description": "A polyfill for the element internals specification",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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