Skip to content

Tag created from the "Create Project" dialog is not assigned to the new project #5117

Closed

Description

@andwati

To Reproduce

  1. Go to Dashboard → Projects and click Create Project.
  2. Fill in a project Name (e.g. test-project).
  3. Open the Tags dropdown and click Create Tag.
  4. Enter a tag name and pick a color, then click Create.
  5. The tag is created — and the project is immediately created too, with no tag attached, redirecting you to the project page.
  6. Open the project's Update dialog, tick the tag, save. Only now is the tag assigned.

Current vs. Expected behavior

Current: Clicking Create in the tag dialog also submits the project form. The project is created straight away with no tags, and the dialog closes before a tag can be selected — so there is also no way to pick more than one tag. The tag has to be assigned manually afterwards by editing the project.

Expected: Creating a tag from the project dialog should only create the tag, leave the project dialog open with the new tag selected, and allow selecting several tags before clicking Create.

Cause: the tag dialog's form is nested inside the project dialog's form in the React tree:

<form id="hook-form-add-project">            handle-project.tsx
  └ TagSelector → Popover → PopoverContent   tag-selector.tsx
      └ HandleTag → Dialog → DialogContent   handle-tag.tsx
          └ <form id="hook-form-tag">

Both are rendered through portals, but React propagates events along the React tree rather than the DOM tree, so the inner form's submit reaches the outer form's onSubmit and creates the project.

Two changes are needed:

  1. handle-tag.tsx — call e.stopPropagation() in the tag form's onSubmit so it cannot submit an enclosing form.
  2. handle-tag.tsx / tag-selector.tsx — the newly created tag is never added to selectedTagIds in handle-project.tsx, so even without the propagation bug tag.bulkAssign would run with an empty array. tag.create already returns the created row, so the selector can select it via a callback.

Provide environment information

Operating System:
  OS: Ubuntu 24.04
  Arch: x86_64
Dokploy version: 0.30.0
VPS Provider: Hetzner
What applications/services are you trying to deploy?
  N/A - this happens at project creation, before any service is added.

Which area(s) are affected? (Select all that apply)

Application

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

Self-hosted instance. The tag itself is created correctly and shows up under Settings → Tags. The same TagSelector is used in the project Update dialog, which has the same problem.

Will you send a PR to fix it?

Yes

Activity

  1. linear-code commented on Aug 18, 2026

    @linear-code
  2. andwati commented on Aug 18, 2026

    @andwati
    ContributorAuthor

    Updated the description: the main cause is the nested tag form submitting the project form through React's portal event propagation, not just the missing tag selection. Fix incoming.

  3. added a commit that references this issue on Aug 18, 2026
    0ea7de7
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions