Wire onSubmitEditing on the picker TextInput so the iOS return key submits a typed daemon-side path through the existing open_project_request flow. Prepend the typed path to options when not already present so it's tappable and participates in keyboard nav.
This commit is contained in:
@@ -94,15 +94,18 @@ export function ProjectPickerModal() {
|
|||||||
retry: false,
|
retry: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const options = useMemo(
|
const options = useMemo(() => {
|
||||||
() =>
|
const suggestedPaths = buildWorkingDirectorySuggestions({
|
||||||
buildWorkingDirectorySuggestions({
|
recommendedPaths,
|
||||||
recommendedPaths,
|
serverPaths: directorySuggestionsQuery.data ?? [],
|
||||||
serverPaths: directorySuggestionsQuery.data ?? [],
|
query,
|
||||||
query,
|
});
|
||||||
}),
|
const trimmedQuery = query.trim();
|
||||||
[query, directorySuggestionsQuery.data, recommendedPaths],
|
if (!trimmedQuery || suggestedPaths.includes(trimmedQuery)) {
|
||||||
);
|
return suggestedPaths;
|
||||||
|
}
|
||||||
|
return [trimmedQuery, ...suggestedPaths];
|
||||||
|
}, [query, directorySuggestionsQuery.data, recommendedPaths]);
|
||||||
|
|
||||||
const handleClose = useCallback(() => {
|
const handleClose = useCallback(() => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
@@ -239,6 +242,8 @@ export function ProjectPickerModal() {
|
|||||||
autoCorrect={false}
|
autoCorrect={false}
|
||||||
autoFocus
|
autoFocus
|
||||||
editable={!isSubmitting}
|
editable={!isSubmitting}
|
||||||
|
returnKeyType="go"
|
||||||
|
onSubmitEditing={handleSubmitCustom}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user