Skip to content

Commit

Permalink
fix 🐛: select item trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
BQXBQX committed Oct 21, 2024
1 parent 21811d6 commit b363ed0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions packages/ui-react/lib/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ export const Select = React.forwardRef<HTMLDivElement, SelectProps>(
const [visible, setVisible] = useState<boolean>(false);
const selectClass = classNames(styles['base'], styles[size], className);
const closeOptions = () => {
setTimeout(() => {
setVisible(false);
}, 100);
setVisible(false);
};
return (
<SelectItemContext.Provider value={selectItemStore}>
Expand All @@ -107,10 +105,10 @@ export const Select = React.forwardRef<HTMLDivElement, SelectProps>(
disabled={disabled}
placeholder={placeHolder}
size={size}
onBlur={closeOptions}
optionsList={optionsList}
onClick={() => setVisible(true)}
onKeyDown={() => setVisible(true)}
onBlur={closeOptions}
closeOptions={() => setVisible(false)}
onChange={onChange}
selectKey={selectKey}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/lib/Select/SelectItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SelectItem = React.forwardRef<HTMLDivElement, SelectItemProps>(
<div
className={`${styles['select-item']} ${rest.className} ${keySelectItem?.key === option.key ? styles['key-select'] : ''}`}
ref={ref}
onClick={() => {
onMouseDown={() => {
updateSelectItem(option);
changeValue(option.label);
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ui-aurora/react",
"version": "0.0.25",
"version": "0.0.26",
"description": "A React UI library built for SASTOJ",
"author": "sast",
"license": "MIT",
Expand Down

1 comment on commit b363ed0

@vercel
Copy link

@vercel vercel bot commented on b363ed0 Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sast-ui – ./

sast-ui-sast.vercel.app
sast-ui-git-main-sast.vercel.app

Please sign in to comment.