Skip to content

feat: Specify max possible options to select in Form multiselect input #17934

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

michael-radency
Copy link
Contributor

Summary

Specify max possible options to select in Form multiselect input
When max is equal 1 field will behave as radiobuttons allowing only single selection

Related Linear tickets, Github issues, and Community forum posts

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

@michael-radency michael-radency added node/improvement New feature or request n8n team Authored by the n8n team labels Aug 2, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Your Name seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

1 issue found across 4 files • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@@ -676,8 +676,14 @@

function validateMultiselect(input, errorElement) {
const selectedValues = getSelectedValues(input);
const maxSelectAllowed = input.dataset.maxSelectAllowed ? parseInt(input.dataset.maxSelectAllowed, 10) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parseInt result is not validated – NaN disables the limit silently, allowing unlimited selections

Prompt for AI agents
Address the following comment on packages/cli/templates/form-trigger.handlebars at line 679:

<comment>parseInt result is not validated – `NaN` disables the limit silently, allowing unlimited selections</comment>

<file context>
@@ -676,8 +676,14 @@
 
 			function validateMultiselect(input, errorElement) {
 				const selectedValues = getSelectedValues(input);
+				const maxSelectAllowed = input.dataset.maxSelectAllowed ? parseInt(input.dataset.maxSelectAllowed, 10) : null;
 
 				if (!selectedValues.length) {
</file context>

@Joffcom Joffcom requested a review from elsmr August 2, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
n8n team Authored by the n8n team node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants