Skip to content

Commit f96948e

Browse files
sergeykadSergey
andauthored
fix(site): allow text selection in Tool Explorer tool names (#1060)
- Add select-text to button to override browser's user-select: none - Guard click handler to skip toggle when text is being selected Co-authored-by: Sergey <sergey@example.com>
1 parent a0805c7 commit f96948e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

site/src/pages/tools.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function getBadgeInfo(annotations: Record<string, any>) {
181181
data-tool-size={totalChars}
182182
data-original-desc={tool.description}
183183
>
184-
<button class="tool-header w-full text-left px-4 py-3 flex items-start gap-3">
184+
<button class="tool-header select-text w-full text-left px-4 py-3 flex items-start gap-3">
185185
<svg class="tool-chevron w-4 h-4 mt-1 text-slate-500 transition-transform shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor">
186186
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />
187187
</svg>
@@ -522,6 +522,7 @@ function getBadgeInfo(annotations: Record<string, any>) {
522522

523523
document.querySelectorAll('.tool-header').forEach(header => {
524524
header.addEventListener('click', () => {
525+
if (window.getSelection()?.type === 'Range') return;
525526
const card = header.closest('.tool-card')!;
526527
const details = card.querySelector('.tool-details')!;
527528
const chevron = card.querySelector('.tool-chevron')!;

0 commit comments

Comments
 (0)