Skip to content

Conversation

@willeastcott
Copy link
Contributor

PR #485 introduced validation to prevent empty or whitespace-only tags in SelectInput. However, this broke use cases where createFn is specified, such as the Editor's Script Component Inspector "Create Script" button.

Changes

  • Skip empty/whitespace validation when createFn is provided
  • Allow createFn to receive empty input so it can handle the flow (e.g., show a dialog to prompt for input)
  • Preserve the original PR Disallow empty or whitespace-only tags #485 fix for tag inputs that don't use createFn

Before

Clicking "Create Script" with empty input did nothing because:

  1. The create label container was hidden for empty input
  2. The click handler returned early before calling createFn

After

When createFn is specified:

  • The create label remains visible with empty input
  • Clicking it calls createFn(''), allowing the callback to handle empty values (e.g., show the script name picker dialog)

@willeastcott willeastcott self-assigned this Jan 6, 2026
@willeastcott willeastcott added the bug Something isn't working label Jan 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression where the createFn callback was being blocked by empty input validation introduced in PR #485. The fix allows components using createFn (like the Script Component Inspector's "Create Script" button) to handle empty inputs themselves, while preserving validation for regular tag inputs.

Key changes:

  • Modified empty/whitespace validation to be conditional on the absence of createFn
  • Updated both the create label visibility logic and click handler to skip validation when createFn is provided

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit 2bba92d into main Jan 6, 2026
11 checks passed
@willeastcott willeastcott deleted the fix-create-func branch January 6, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants