Add notes for min_values requirement for required components in label components#8177
Open
The-LukeZ wants to merge 8 commits intodiscord:mainfrom
Open
Add notes for min_values requirement for required components in label components#8177The-LukeZ wants to merge 8 commits intodiscord:mainfrom
The-LukeZ wants to merge 8 commits intodiscord:mainfrom
Conversation
…s and requirements
… and requirements
…es and requirements Better consistency with the other notes from before
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds clarification for the
min_valuesconstraint when using select menus or other components with amin_valuesfield inside label components withrequired: true.Changes
Added a note to all components stating:
Reordered the
\*note order to ensure it stays consistent.Used the phrasing requested by @anthonydiscord in my last PR (#8105)
The API rejects modals containing required select menus with
min_values: 0, but this constraint is not documented (well). This creates confusion for developers who encounter validation errors when trying to use this combination.Setting
min_values: 0withrequired: truecreates a logical conflict:required: truemeans the user must interact with the componentmin_values: 0means the user can select nothingThis note helps developers understand the constraint and avoid this common pitfall.
I experienced this because users can build their own forms and the docs currently state "0 - 25"
Please let me know if any further changes should be made.
As said before, I already made a PR (#8105) before but then couldn't continue working on it. I now needed to redo all changes because of the docs-rework.