saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4434685719
##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -241,12 +315,31 @@ export default {
updateComputeCpuSpeed (value) {
this.$emit('update-compute-cpuspeed', this.cpuSpeedInputDecorator, value)
},
- updateComputeMemory (value) {
- if (!value) this.memoryInputValue = 0
- if (!this.validateInput('memory', value)) {
+ updateComputeMemory (displayValue) {
+ if (displayValue === null || displayValue === undefined) {
+ this.memoryDisplayValue = 0
+ displayValue = 0
Review Comment:
Good catch @Damans227!
The issue was that updateComputeMemory was defaulting displayValue to 0 when
empty before running validateInput, which caused unconstrained offerings
(!isConstrained) to treat 0 as a valid number and emit it.
I have fixed this by:
Preserving the cleared state (null / empty string) passed into validateInput
so it properly triggers the required field check (message.error.required.input).
Ensuring updateComputeMemory returns early and does not emit 0 when
validation fails.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]