Fix(Sidebar): Fix the bug that submenu can not display #54

Merged
FatttSnake merged 1 commits from FatttSnake into dev 2024-05-11 21:16:45 +08:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit da32a27ad6 - Show all commits

View File

@@ -152,6 +152,10 @@
padding: 8px 16px;
transition: all 0.2s;
.text {
width: unset;
}
&.active {
color: constants.$origin-color;
background-color: constants.$main-color;

View File

@@ -12,8 +12,8 @@ type ItemProps = {
}
const Item = (props: ItemProps) => {
const [submenuTop, setSubmenuTop] = useState(0)
const [submenuLeft, setSubmenuLeft] = useState(0)
const [submenuTop, setSubmenuTop] = useState(Number.MAX_VALUE)
const [submenuLeft, setSubmenuLeft] = useState(Number.MAX_VALUE)
const showSubmenu = (e: MouseEvent) => {
const parentElement = e.currentTarget.parentElement