diff --git a/.gitignore b/.gitignore index b3ef8b6db115..36e69849cb70 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ dist dump.rdb env venv* +.cursor/* env_py3 envpy3 local_config.py diff --git a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx index 85236ca3a452..76885726c3a0 100644 --- a/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx +++ b/superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx @@ -85,10 +85,9 @@ export const VIZ_TYPE_CONTROL_TEST_ID = 'viz-type-control'; const VizPickerLayout = styled.div<{ isSelectedVizMetadata: boolean }>` ${({ isSelectedVizMetadata }) => ` display: grid; - grid-template-rows: ${ - isSelectedVizMetadata - ? `auto minmax(100px, 1fr) minmax(200px, 35%)` - : 'auto minmax(100px, 1fr)' + grid-template-rows: ${isSelectedVizMetadata + ? `auto minmax(100px, 1fr) minmax(200px, 35%)` + : 'auto minmax(100px, 1fr)' }; // em is used here because the sidebar should be sized to fit the longest standard tag grid-template-columns: minmax(14em, auto) 5fr; @@ -585,6 +584,13 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) { searchInputRef.current!.blur(); }, []); + // Auto-focus the search input when the component mounts (modal opens) + useEffect(() => { + if (searchInputRef.current) { + searchInputRef.current.focus(); + } + }, []); + const clickSelector = useCallback( (selector: string, sectionId: string) => { if (isSearchFocused) { @@ -818,11 +824,11 @@ export default function VizTypeGallery(props: VizTypeGalleryProps) { {(selectedVizMetadata?.exampleGallery?.length ? selectedVizMetadata.exampleGallery : [ - { - url: selectedVizMetadata?.thumbnail, - caption: selectedVizMetadata?.name, - }, - ] + { + url: selectedVizMetadata?.thumbnail, + caption: selectedVizMetadata?.name, + }, + ] ).map(example => (