@joinbox/formsync
Advanced tools
+11
-0
@@ -6,2 +6,13 @@ # Change Log | ||
| ## 2.0.1 (2021-06-01) | ||
| ### Bug Fixes | ||
| * **formsync:** only autosubmit form if input is valid ([b1753a0](https://github.com/joinbox/ui-components/commit/b1753a0c53ca06df0071d8fb033f84585ac691af)) | ||
| # 2.0.0 (2021-05-28) | ||
@@ -8,0 +19,0 @@ |
@@ -132,2 +132,7 @@ (function () { | ||
| submitOriginalForm() { | ||
| // Only submit form if input is valid; is needed to e.g. not submit a form on a date | ||
| // input that reads 0002-01-01 (which is what happens when user enters 01012); to prevent | ||
| // it, use e.g. min="2021-05-31"; the form will only be submitted if the value entered | ||
| // is in the future. | ||
| if (!this.clonedElement.checkValidity()) return; | ||
| submitForm(this.getOriginalForm()); | ||
@@ -134,0 +139,0 @@ } |
+2
-2
| { | ||
| "name": "@joinbox/formsync", | ||
| "version": "2.0.0", | ||
| "version": "2.0.1", | ||
| "description": "Synchronizes forms and elements between an original form (e.g. one created by Drupal) and another form (e.g. freely created as a template based on mockups).", | ||
@@ -32,3 +32,3 @@ "main": "FormSync.js", | ||
| }, | ||
| "gitHead": "a91f39937e92e529ca13ed7e7198d1aa5063d20f" | ||
| "gitHead": "77ccc8ebbb0505bf30c80564d1e51f7d3985964b" | ||
| } |
+5
-0
@@ -54,2 +54,7 @@ import submitForm from './submitForm.js'; | ||
| submitOriginalForm() { | ||
| // Only submit form if input is valid; is needed to e.g. not submit a form on a date | ||
| // input that reads 0002-01-01 (which is what happens when user enters 01012); to prevent | ||
| // it, use e.g. min="2021-05-31"; the form will only be submitted if the value entered | ||
| // is in the future. | ||
| if (!this.clonedElement.checkValidity()) return; | ||
| submitForm(this.getOriginalForm()); | ||
@@ -56,0 +61,0 @@ } |
@@ -187,2 +187,7 @@ import { dirname } from 'path'; | ||
| // Only submit if elemtn is valid | ||
| target.setCustomValidity('invalid state'); | ||
| target.dispatchEvent(new window.Event('change')); | ||
| t.is(submitted, 2); | ||
| // Don't submit if original changes | ||
@@ -189,0 +194,0 @@ source.dispatchEvent(new window.Event('change')); |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
74974
1.53%1458
0.97%0
-100%