Skip to content

Commit

Permalink
fix(slash): reset index when out of bounds (#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
sindras authored Oct 14, 2024
1 parent ccda9d8 commit a1262cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/crepe/src/feature/block-edit/menu/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const menuComponent: Component<MenuProps> = ({
}, [])

useEffect(() => {
if (size === 0 && show)
hide?.()
if (size === 0 && show) hide?.()
else if (hoverIndex >= size) setHoverIndex(0)
}, [size, show])

const onHover = useCallback((
Expand Down

0 comments on commit a1262cf

Please sign in to comment.