Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hungry-socks-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

fix: allow dropdowns in Modes modal to be changed
20 changes: 16 additions & 4 deletions webview-ui/src/components/kilocode/rules/KiloRulesToggleModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRef, useState, useEffect } from "react"
import { useWindowSize, useClickAway } from "react-use"
import { useWindowSize } from "react-use"
import { useTranslation } from "react-i18next"
import styled from "styled-components"

Expand Down Expand Up @@ -30,9 +30,21 @@ const KiloRulesToggleModal: React.FC = () => {
const [menuPosition, setMenuPosition] = useState(0)
const [currentView, setCurrentView] = useState<"modes" | "mcp" | "rule" | "workflow" | "skills">("rule")

useClickAway(modalRef, () => {
setIsVisible(false)
})
useEffect(() => {
const handler = (event: MouseEvent | TouchEvent) => {
const target = event.target as HTMLElement
if (modalRef.current?.contains(target)) return
// Ignore clicks on Radix portaled content (Select/Popover dropdowns)
if (target.closest("[data-radix-popper-content-wrapper]")) return
setIsVisible(false)
}
document.addEventListener("mousedown", handler)
document.addEventListener("touchstart", handler)
return () => {
document.removeEventListener("mousedown", handler)
document.removeEventListener("touchstart", handler)
}
}, [])

useEffect(() => {
if (isVisible && buttonRef.current) {
Expand Down
Loading