mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
refactor(InputWithSelect): remove manual clamp of minmax
This commit is contained in:
parent
96a93bfe2a
commit
5d21b9fadd
1 changed files with 0 additions and 13 deletions
|
|
@ -156,16 +156,6 @@ document.addEventListener('alpine:init', () => {
|
||||||
return { value: combined, unit: config.defaultUnit };
|
return { value: combined, unit: config.defaultUnit };
|
||||||
},
|
},
|
||||||
|
|
||||||
validateAndClamp() {
|
|
||||||
const numValue = parseFloat(this.inputValue);
|
|
||||||
if (isNaN(numValue)) return;
|
|
||||||
if (config.min !== null && numValue < config.min) {
|
|
||||||
this.inputValue = String(config.min);
|
|
||||||
} else if (config.max !== null && numValue > config.max) {
|
|
||||||
this.inputValue = String(config.max);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
toStructured() {
|
toStructured() {
|
||||||
return {
|
return {
|
||||||
value: this.inputValue || '',
|
value: this.inputValue || '',
|
||||||
|
|
@ -183,14 +173,11 @@ document.addEventListener('alpine:init', () => {
|
||||||
},
|
},
|
||||||
|
|
||||||
updateStructured() {
|
updateStructured() {
|
||||||
this.validateAndClamp();
|
|
||||||
this.structuredValue = this.toStructured();
|
this.structuredValue = this.toStructured();
|
||||||
this.updateCombined();
|
this.updateCombined();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleInputChange() {
|
handleInputChange() {
|
||||||
this.validateAndClamp();
|
|
||||||
|
|
||||||
if (this.pendingSync) {
|
if (this.pendingSync) {
|
||||||
clearTimeout(this.pendingSync);
|
clearTimeout(this.pendingSync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue