select

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

commit
707014eeff3dde3734288c3f92697378fd51081c
parent
f58e4f62abddd65707c39fcedb2ff22f13498c7a
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-08-08 11:09
run initial updateValue when elements are attached to DOM

Diffstat

M select.js 4 ++--
M tags.js 4 ++--

2 files changed, 4 insertions, 4 deletions


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

@@ -11,6 +11,8 @@ export class Select {
   11    11 		this.createElements();
   12    12 		original.hidden = true;
   13    13 		original.before(this.wrapper);
   -1    14 
   -1    15 		this.updateValue();
   14    16 	}
   15    17 
   16    18 	createElements() {
@@ -58,8 +60,6 @@ export class Select {
   58    60 		this.dropdown.onmousedown = event => {
   59    61 			event.preventDefault();
   60    62 		};
   61    -1 
   62    -1 		this.updateValue();
   63    63 	}
   64    64 
   65    65 	isMatch(s) {

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

@@ -9,6 +9,8 @@ export class TagInput {
    9     9 		this.createElements();
   10    10 		original.hidden = true;
   11    11 		original.before(this.wrapper);
   -1    12 
   -1    13 		this.updateValue();
   12    14 	}
   13    15 
   14    16 	createElements() {
@@ -39,8 +41,6 @@ export class TagInput {
   39    41 		this.original.onchange = () => {
   40    42 			this.input.setCustomValidity(this.original.validationMessage);
   41    43 		};
   42    -1 
   43    -1 		this.updateValue();
   44    44 	}
   45    45 
   46    46 	updateValue() {