Skip to content

Commit 5d7ea19

Browse files
committed
fix(gateway): position cursor before placeholder in custom claim form
When a text field is empty, the cursor now appears before the placeholder hint instead of after it, matching expected input behavior.
1 parent e2ede93 commit 5d7ea19

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/cli/tui/screens/mcp/AddGatewayScreen.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,10 +1020,11 @@ function CustomClaimForm({ initialClaim, onSave, onCancel }: CustomClaimFormProp
10201020
<Box marginTop={1} flexDirection="column">
10211021
<Box>
10221022
<Text color={activeField === 'claimName' ? 'cyan' : 'gray'}>Claim name: </Text>
1023+
{activeField === 'claimName' && !claimName && <Cursor />}
10231024
<Text color={activeField === 'claimName' ? undefined : 'gray'}>
10241025
{claimName || <Text dimColor>e.g., department</Text>}
10251026
</Text>
1026-
{activeField === 'claimName' && <Cursor />}
1027+
{activeField === 'claimName' && claimName && <Cursor />}
10271028
</Box>
10281029

10291030
<Box>
@@ -1054,14 +1055,15 @@ function CustomClaimForm({ initialClaim, onSave, onCancel }: CustomClaimFormProp
10541055

10551056
<Box>
10561057
<Text color={activeField === 'matchValue' ? 'cyan' : 'gray'}>Match value: </Text>
1058+
{activeField === 'matchValue' && !matchValue && <Cursor />}
10571059
<Text color={activeField === 'matchValue' ? undefined : 'gray'}>
10581060
{matchValue || (
10591061
<Text dimColor>
10601062
{valueType === 'STRING_ARRAY' ? 'comma-separated, e.g., admin, dev' : 'e.g., engineering'}
10611063
</Text>
10621064
)}
10631065
</Text>
1064-
{activeField === 'matchValue' && <Cursor />}
1066+
{activeField === 'matchValue' && matchValue && <Cursor />}
10651067
</Box>
10661068
</Box>
10671069

0 commit comments

Comments
 (0)