@@ -17,7 +17,7 @@ import { FormElement, FormElementProps } from './FormElement';
1717import { Icon } from './Icon' ;
1818import { AutoAlign } from './AutoAlign' ;
1919import { DropdownMenuProps } from './DropdownMenu' ;
20- import { isElInChildren } from './util' ;
20+ import { registerStyle , isElInChildren } from './util' ;
2121import { ComponentSettingsContext } from './ComponentSettings' ;
2222import { useControlledValue , useEventCallback , useMergeRefs } from './hooks' ;
2323import { createFC } from './common' ;
@@ -150,6 +150,20 @@ const PicklistContext = createContext<{
150150 optionIdPrefix : '' ,
151151} ) ;
152152
153+ /**
154+ *
155+ */
156+ function useInitComponentStyle ( ) {
157+ useEffect ( ( ) => {
158+ registerStyle ( 'picklist' , [
159+ [
160+ '.react-slds-picklist-dropdown' ,
161+ '{ left: 0; transform: translateX(0); }' ,
162+ ] ,
163+ ] ) ;
164+ } , [ ] ) ;
165+ }
166+
153167/**
154168 *
155169 */
@@ -225,6 +239,8 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
225239 ...rprops
226240 } = props ;
227241
242+ useInitComponentStyle ( ) ;
243+
228244 const fallbackId = useId ( ) ;
229245 const id = id_ ?? fallbackId ;
230246 const listboxId = `${ id } -listbox` ;
@@ -528,6 +544,7 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
528544 }
529545 ) ;
530546 const dropdownClassNames = classnames (
547+ 'react-slds-picklist-dropdown' ,
531548 'slds-dropdown' ,
532549 'slds-dropdown_length-5' ,
533550 menuSize ? `slds-dropdown_${ menuSize } ` : 'slds-dropdown_fluid'
0 commit comments