mirror of
https://github.com/FJurmanovic/wallet-web.git
synced 2026-02-06 06:08:10 +00:00
fixed submit validation
This commit is contained in:
@@ -36,7 +36,7 @@ class AppFormElement extends BaseComponentElement {
|
||||
|
||||
public onSubmit = (e) => {
|
||||
e.preventDefault();
|
||||
if (!this.valid) {
|
||||
if (!this.isValid) {
|
||||
return;
|
||||
}
|
||||
this.submitFunc?.(this.values);
|
||||
@@ -97,16 +97,6 @@ class AppFormElement extends BaseComponentElement {
|
||||
return formObject;
|
||||
};
|
||||
|
||||
get valid() {
|
||||
let _valid = 0;
|
||||
this.inputField?.forEach((input) => {
|
||||
if (input.required && (input.inp as HTMLSelectElement).value) {
|
||||
_valid++;
|
||||
}
|
||||
});
|
||||
return _valid == this.inputField?.length;
|
||||
}
|
||||
|
||||
elementConnected = (): void => {
|
||||
if (this.renderInput) {
|
||||
this.update();
|
||||
|
||||
Reference in New Issue
Block a user