Skip to content

How should the Select all functionality be implemented using the array? #1132

Discussion options

You must be logged in to vote

UPD: I found that the form/field can be manually validated using the following methods:

Therefore, the handleCourseIdsChange can be updated in the following way:

if (name === 'all') {
	form.setFieldValue('targetCourseIds', checked ? copyTargetIds : []);
+	await form.validateField('targetCourseIds', 'change');
	return;
}

That forces the validation to run and properly change the canSubmit value!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by oleksandr-danylchenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant