mirror of
https://github.com/umap-project/umap.git
synced 2025-05-05 06:01:48 +02:00
feat: add throttling for text input elements
This commit is contained in:
parent
33b0f6c318
commit
d4ffae09da
1 changed files with 10 additions and 0 deletions
|
@ -241,6 +241,16 @@ L.FormBuilder.Element.include({
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
L.FormBuilder.Input.include({
|
||||||
|
set: function () {
|
||||||
|
// Add throttling
|
||||||
|
if (this._typing) window.clearTimeout(this._typing)
|
||||||
|
this._typing = window.setTimeout(() => {
|
||||||
|
this.builder.setter(this.field, this.toJS())
|
||||||
|
}, 300)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
L.FormBuilder.Select.include({
|
L.FormBuilder.Select.include({
|
||||||
clear: function () {
|
clear: function () {
|
||||||
this.select.value = ''
|
this.select.value = ''
|
||||||
|
|
Loading…
Reference in a new issue