feat: add event handling to blur current target element after showing popup

- Added event handling to the onSelectModel function to blur the current target element after showing the SelectModelPopup.
This commit is contained in:
kangfenmao 2024-10-12 10:00:03 +08:00
parent d41667b599
commit 8bb5fb9811

View File

@ -23,7 +23,8 @@ const SelectModelButton: FC<Props> = ({ assistant }) => {
return null return null
} }
const onSelectModel = async () => { const onSelectModel = async (event: React.MouseEvent<HTMLElement>) => {
event.currentTarget.blur()
const selectedModel = await SelectModelPopup.show({ model }) const selectedModel = await SelectModelPopup.show({ model })
if (selectedModel) { if (selectedModel) {
setModel(selectedModel) setModel(selectedModel)