Skip to content

Input onTextEditEnd not firing while UI is open, widget actions also blocked #33

@erikdotdesign

Description

@erikdotdesign

Summary

When using the <Input> element inside a widget, the onTextEditEnd handler does not fire if the plugin UI is open (via figma.showUI). Additionally, all other widget actions (e.g. onClick) appear blocked or deferred until the UI is closed (after editing the <Input>).

Steps to Reproduce

  1. Add an <Input> with onTextEditEnd inside a widget.
  2. Add a button that calls figma.showUI() on click.
  3. Open the UI
  4. Add text to <Input> and blur
  5. Observe that: onTextEditEnd never fires and any widget actions (e.g. button click logs or follow-up actions) are deferred until the UI is closed.

Expected Behavior

  • onTextEditEnd should fire when focus leaves the <Input>, even if the plugin UI is opened.
  • Other widget actions should run immediately, not be blocked or queued until the UI closes.

Actual Behavior

  • onTextEditEnd only fires when the UI is closed.
  • Widget interactions (like clicks) seem blocked while the UI is open (after input blur) — no console logs, no state updates.

Sample Code

const { widget } = figma;
const { AutoLayout, Input, Text } = widget;

const Widget = () => {
  const handleBlur = () => {
    console.log('input blur');
  }

  return (
    <AutoLayout>
      <Input
        value={""}
        onTextEditEnd={handleBlur}
        placeholder="placeholder..."
      />
      <AutoLayout
        onClick={async () => {
          await new Promise(() => {
            figma.showUI("<script></script>", { height: 40, width: 196 });
          });
        }}>
        <Text>Open UI</Text>
      </AutoLayout>
    </AutoLayout>
  );
};

widget.register(Widget);

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