mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: folder rows no longer nest action buttons inside a button
This commit is contained in:
1 parent
ab2307bab4
commit
0324d27f13
2 files changed
+86
-2
No files matched your search
@@ -168,7 +168,18 @@ export function FolderItem({
|
||||
style={depth > 0 ? { paddingLeft: rem(depth * 12) } : undefined}
|
||||
>
|
||||
<div className="relative">
|
||||
<button
|
||||
{/* A div, not a button: the folder actions inside are buttons. */}
|
||||
<div
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-expanded={isOpen}
|
||||
onKeyDown={(e) => {
|
||||
if (e.target !== e.currentTarget) return;
|
||||
if (e.key === "Enter" || e.key === " ") {
|
||||
e.preventDefault();
|
||||
if (!query) onToggleFolder(folderPath);
|
||||
}
|
||||
}}
|
||||
draggable={canDragFolder}
|
||||
onDragStart={(e) => {
|
||||
if (!canDragFolder) return;
|
||||
@@ -294,7 +305,7 @@ export function FolderItem({
|
||||
)}
|
||||
</>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{!flat && isOpen && (
|
||||
<div className="border-l border-border/50 ml-[27px]">
|
||||
|
||||
Reference in new issue
Block a user