select

Better select widgets in vanilla javascript.  https://p.ce9e.org/select/demo/
git clone https://git.ce9e.org/select.git

commit
cfe4dae4e1d4c2b02048857f83b5324148c6711b
parent
712764601927ea70bcf6e25c65875cbd193ed1d5
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-11-08 15:45
set input required if original is required and empty

This will trigger validation on input, since original is hidden

Diffstat

M select.js 2 ++
M tags.js 1 +

2 files changed, 3 insertions, 0 deletions


diff --git a/select.js b/select.js

@@ -125,6 +125,8 @@ export class Select {
  125   125 				this.input.setCustomValidity('');
  126   126 			}
  127   127 		}
   -1   128 
   -1   129 		this.input.required = this.original.required && !this.original.value;
  128   130 	}
  129   131 
  130   132 	createOption(op, i) {

diff --git a/tags.js b/tags.js

@@ -109,6 +109,7 @@ export class TagInput {
  109   109 				op.remove();
  110   110 			}
  111   111 		});
   -1   112 		this.input.required = this.original.required && !this.original.value;
  112   113 	}
  113   114 }
  114   115