-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add max per option validator and onkeyon for votes input fields #4492
Add max per option validator and onkeyon for votes input fields #4492
Conversation
The on change is still needed, for mouse updates. The on key up checks without focus lose.
@@ -1,11 +1,11 @@ | |||
import { AbstractControl, ValidatorFn } from '@angular/forms'; | |||
|
|||
export function isNumberRange(minCtrlName: string, maxCtrlName: string): ValidatorFn { | |||
export function isNumberRange(minCtrlName: string, maxCtrlName: string, errorName: string): ValidatorFn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a good idea to set a default value for that.
export function isNumberRange(minCtrlName: string, maxCtrlName: string, errorName: string): ValidatorFn { | |
export function isNumberRange(minCtrlName: string, maxCtrlName: string, errorName: string = `rangeError`): ValidatorFn { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a default to the validator and use default where possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As min-votes, max-votes and max-votes-per option is one form group it is not easy possible to have the validator on just two of the fields. |
Add a fix for the problem with setting to 'N' method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function
both described things are fixed
Resolve #4453