1
1
import { isPhone , isTablet } from '@ui5/webcomponents-base/dist/Device.js' ;
2
2
import searchIcon from '@ui5/webcomponents-icons/dist/search.js' ;
3
- import { enrichEventWithDetails , ThemingParameters , useI18nBundle } from '@ui5/webcomponents-react-base' ;
3
+ import {
4
+ enrichEventWithDetails ,
5
+ ThemingParameters ,
6
+ useI18nBundle ,
7
+ useIsomorphicId
8
+ } from '@ui5/webcomponents-react-base' ;
4
9
import type { MouseEventHandler , ReactNode } from 'react' ;
5
10
import React , { Children , useEffect , useRef , useState } from 'react' ;
6
11
import { createPortal } from 'react-dom' ;
@@ -83,8 +88,8 @@ interface ManageViewsDialogPropTypes {
83
88
showSetAsDefault : boolean ;
84
89
showCreatedBy : boolean ;
85
90
variantNames : string [ ] ;
86
- portalContainer : Element ;
87
- showOnlyFavorites ?: boolean ;
91
+ portalContainer : VariantManagementPropTypes [ 'portalContainer' ] ;
92
+ showOnlyFavorites ?: VariantManagementPropTypes [ 'showOnlyFavorites' ] ;
88
93
onManageViewsCancel ?: VariantManagementPropTypes [ 'onManageViewsCancel' ] ;
89
94
}
90
95
@@ -102,6 +107,7 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
102
107
showOnlyFavorites,
103
108
onManageViewsCancel
104
109
} = props ;
110
+ const uniqueId = useIsomorphicId ( ) ;
105
111
const i18nBundle = useI18nBundle ( '@ui5/webcomponents-react' ) ;
106
112
const cancelText = i18nBundle . getText ( CANCEL ) ;
107
113
const saveText = i18nBundle . getText ( SAVE ) ;
@@ -256,10 +262,12 @@ export const ManageViewsDialog = (props: ManageViewsDialogPropTypes) => {
256
262
onAfterClose = { onAfterClose }
257
263
onBeforeClose = { handleClose }
258
264
headerText = { manageViewsText }
265
+ initialFocus = { `search-${ uniqueId } ` }
259
266
header = {
260
267
< FlexBox direction = { FlexBoxDirection . Column } style = { { width : '100%' } } alignItems = { FlexBoxAlignItems . Center } >
261
268
< h2 className = { classes . headerText } > { manageViewsText } </ h2 >
262
269
< Input
270
+ id = { `search-${ uniqueId } ` }
263
271
className = { classes . search }
264
272
placeholder = { searchText }
265
273
showClearIcon
0 commit comments