Skip to content

Commit b226640

Browse files
tweak a style of Picklist input
1 parent 4adb664 commit b226640

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/scripts/Picklist.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { FormElement, FormElementProps } from './FormElement';
1717
import { Icon } from './Icon';
1818
import { AutoAlign, RectangleAlignment } from './AutoAlign';
1919
import { DropdownMenuProps } from './DropdownMenu';
20-
import { isElInChildren } from './util';
20+
import { registerStyle, isElInChildren } from './util';
2121
import { ComponentSettingsContext } from './ComponentSettings';
2222
import { useControlledValue, useEventCallback, useMergeRefs } from './hooks';
2323
import { createFC } from './common';
@@ -185,6 +185,18 @@ const PicklistContext = createContext<{
185185
optionIdPrefix: '',
186186
});
187187

188+
/**
189+
*
190+
*/
191+
function useInitComponentStyle() {
192+
useEffect(() => {
193+
registerStyle('picklist', [
194+
['.react-picklist-input:focus-visible', '{ outline: none; }'],
195+
['.react-picklist-input:not(:disabled)', '{ cursor: pointer; }'],
196+
]);
197+
}, []);
198+
}
199+
188200
/**
189201
*
190202
*/
@@ -262,6 +274,8 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
262274
...rprops
263275
} = props;
264276

277+
useInitComponentStyle();
278+
265279
const fallbackId = useId();
266280
const id = id_ ?? fallbackId;
267281
const listboxId = `${id}-listbox`;
@@ -557,6 +571,7 @@ export const Picklist: (<MultiSelect extends boolean | undefined>(
557571
}
558572
);
559573
const inputClassNames = classnames(
574+
'react-picklist-input',
560575
'slds-input_faux',
561576
'slds-combobox__input',
562577
{

0 commit comments

Comments
 (0)