- commit
- 49460bb57fce1861c19e74a769a7c823136a0397
- parent
- 327c5fef266de1923be6d00f761d6952100377b0
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2021-03-25 15:30
do not setValue on blur on empty input
Diffstat
| M | select.js | 7 | ++++++- |
1 files changed, 6 insertions, 1 deletions
diff --git a/select.js b/select.js
@@ -204,7 +204,12 @@ class Select {
204 204
205 205 onblur(event) {
206 206 if (event.relatedTarget !== this.dropdown) {
207 -1 if (this.indexMap.length) {
-1 207 if (!this.input.value) {
-1 208 if (!this.original.multiple) {
-1 209 this.original.value = '';
-1 210 }
-1 211 this.close();
-1 212 } else if (this.indexMap.length) {
208 213 this.setValue(this.indexMap[this.focus]);
209 214 }
210 215 if (!this.original.checkValidity()) {