Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

reiterl
Copy link
Member

@reiterl reiterl commented Dec 18, 2024

Resolve #4453

The on change is still needed, for mouse updates.
The on key up checks without focus lose.
@reiterl reiterl added the bug label Dec 18, 2024
@reiterl reiterl added this to the 4.3 milestone Dec 18, 2024
@@ -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 {
Copy link
Member

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.

Suggested change
export function isNumberRange(minCtrlName: string, maxCtrlName: string, errorName: string): ValidatorFn {
export function isNumberRange(minCtrlName: string, maxCtrlName: string, errorName: string = `rangeError`): ValidatorFn {

Copy link
Member Author

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.

@reiterl reiterl requested a review from bastianjoel December 19, 2024 09:48
@bastianjoel bastianjoel removed their assignment Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elections: two issues in cumulative voting
3 participants