Skip to content

Commit

Permalink
Fixed: issue regarding decimal numbers can be entered in alert input(#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ymaheshwari1 committed Apr 25, 2024
1 parent 59e93f4 commit 0adadce
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,13 @@ async function updateAutoCancelDays() {
placeholder: translate("auto cancel days"),
type: "number",
min: 0,
value: inventoryRuleActions.value[actionEnums["AUTO_CANCEL_DAYS"].id]?.actionValue
value: inventoryRuleActions.value[actionEnums["AUTO_CANCEL_DAYS"].id]?.actionValue,
attributes: {
// Added check to not allow mainly .(period) and other special characters to be entered in the alert input
onkeydown: ($event: any) => {
if(/[`!@#$%^&*()_+\-=\\|,.<>?~]/.test($event.key)) $event.preventDefault();
}
}
}],
buttons: [{
text: translate("Cancel"),
Expand All @@ -726,10 +732,8 @@ async function updateAutoCancelDays() {
}
}
} else {
// If we have received an empty/undefined value for autoCancelDays then considered that it needs to be removed
if(inventoryRuleActions.value[actionEnums["AUTO_CANCEL_DAYS"].id]?.actionValue) {
delete inventoryRuleActions.value[actionEnums["AUTO_CANCEL_DAYS"].id]
}
showToast(translate("Enter a valid value"))
return false;
}
updateRule()
}
Expand Down

0 comments on commit 0adadce

Please sign in to comment.