fix sidebar closes when click on a selection item

This commit is contained in:
SrGooglo 2022-12-22 12:26:52 +00:00
parent dc9d71d499
commit 482be1da77

View File

@ -63,6 +63,10 @@ const generateItems = () => {
const CustomRender = (props) => { const CustomRender = (props) => {
const handleClickOutside = (event) => { const handleClickOutside = (event) => {
if (props.sidebarRef.current && !props.sidebarRef.current.contains(event.target)) { if (props.sidebarRef.current && !props.sidebarRef.current.contains(event.target)) {
if (event.target.closest(".ant-select-item")) {
return
}
props.closeRender() props.closeRender()
} }
} }