Skip to content

VariableText and VariableTextArea controls append a trailing space after a picked variable, with no way to turn it off #288

Open

Description

@TJReinert

What happens

Picking a suggestion in a VariableText or VariableTextArea field inserts the reference followed by a space, for example {{nodes.abc.response}} plus a trailing space. The space is saved in the property value. When the field holds a single reference (an id, a URL segment, a lookup key), the trailing space makes the resolved value wrong. For us it caused failures at runtime.

There's no supported way to turn it off. The docs list only placeholder (and minRows) for these controls.

Why

VariableText defaults the react-mentions option to true:

packages/sdk/src/features/variables/components/variable-text/variable-text.tsx:254

The two controls that render it don't set it, so they always get the default:

packages/sdk/src/features/json-form/controls/variable-text-control/variable-text-control.tsx:32
packages/sdk/src/features/json-form/controls/variable-text-area-control/variable-text-area-control.tsx:32

Other callers of the same component already set it to false:

packages/sdk/src/features/variables/components/variable-select/variable-select.tsx
packages/sdk/src/features/variables/components/dynamic-typed-input/dynamic-typed-input.tsx
packages/sdk/src/features/json-form/controls/dynamic-conditions-control/dynamic-conditions-form-field/conditions-form-field.tsx

Why we can't work around it from outside

VariableText and VariableTextArea are the only controls that bind a free-text property to the {{ picker. A custom renderer can't replace them cleanly, because the mention component and the upstream-suggestions hook aren't exported from @workflowbuilder/sdk.

Desired Behavior

A way to have these two controls insert a reference without the trailing space. We'd like to keep the current behavior for existing nodes, so that a node author can opt out per field. We're happy with whatever shape you prefer.

Version: @workflowbuilder/sdk 3.0.0

Activity

  1. piotrblaszczyk commented on Nov 24, 2026

    @piotrblaszczyk
    Contributor

    Thanks, confirmed. This is an oversight on our side, not a design choice.

    We will add a per-field option to turn the space off. It will land after #76, which rewrites both controls. For now, trimming the value on your side is the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions