diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/attach_index_box.tsx b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/attach_index_box.tsx index 8b5bb17020ac0..5a2e279026bda 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/attach_index_box.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/components/connector_detail/attach_index_box.tsx @@ -222,6 +222,12 @@ export const AttachIndexBox: React.FC = ({ connector }) => )} isLoading={isLoading} options={groupedOptions} + onKeyDown={(event) => { + // Index name should not contain spaces + if (event.key === ' ') { + event.preventDefault(); + } + }} onSearchChange={(searchValue) => { setQuery({ isFullMatch: options.some((option) => option.label === searchValue),