[PR #1159] [CLOSED] fix: prevent custom registry org input from deselecting #4112

Closed
opened 2026-04-13 15:19:59 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/moghtech/komodo/pull/1159
Author: @litlmike
Created: 2/7/2026
Status: Closed

Base: mainHead: fix-issue-1094


📝 Commits (1)

  • 6919582 fix: prevent custom registry org input from deselecting

📊 Changes

1 file changed (+1 additions, -6 deletions)

View changed files

📝 frontend/src/components/resources/build/config.tsx (+1 -6)

📄 Description

Summary

Fixes the bug where typing in the 'Custom' organization name field in the Build Config's Image Registry section would deselect after entering a single character.

Root Cause

The \ImageRegistryConfig\ component's React key included
egistry.organization:

\\jsx
key={
(registry.domain ?? '') +
(registry.organization ?? '') + // This changes on every keystroke!
(registry.account ?? '') +
index
}
\\

When the user types a character in the custom organization input, the organization value changes, which changes the key. React interprets this as a new component and unmounts/remounts it, destroying the \OrganizationSelector's internal \customMode\ state and switching back to the dropdown view.

Fix

Use a stable \index-based key that doesn't change when the registry data is edited:

\\jsx
key={index}
\\

This preserves component identity during edits while still allowing React to efficiently reconcile the list.

Closes #1094


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/moghtech/komodo/pull/1159 **Author:** [@litlmike](https://github.com/litlmike) **Created:** 2/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix-issue-1094` --- ### 📝 Commits (1) - [`6919582`](https://github.com/moghtech/komodo/commit/6919582f69656733e681e44a142baaecffe4a259) fix: prevent custom registry org input from deselecting ### 📊 Changes **1 file changed** (+1 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/resources/build/config.tsx` (+1 -6) </details> ### 📄 Description ## Summary Fixes the bug where typing in the 'Custom' organization name field in the Build Config's Image Registry section would deselect after entering a single character. ## Root Cause The \ImageRegistryConfig\ component's React key included \ egistry.organization\: \\\jsx key={ (registry.domain ?? '') + (registry.organization ?? '') + // This changes on every keystroke! (registry.account ?? '') + index } \\\ When the user types a character in the custom organization input, the organization value changes, which changes the key. React interprets this as a new component and unmounts/remounts it, destroying the \OrganizationSelector\'s internal \customMode\ state and switching back to the dropdown view. ## Fix Use a stable \index\-based key that doesn't change when the registry data is edited: \\\jsx key={index} \\\ This preserves component identity during edits while still allowing React to efficiently reconcile the list. Closes #1094 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 15:19:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/komodo#4112