diff --git a/src/renderer/components/GitSidebar/GitSidebar.css b/src/renderer/components/GitSidebar/GitSidebar.css index bde8ae5..05b73cf 100644 --- a/src/renderer/components/GitSidebar/GitSidebar.css +++ b/src/renderer/components/GitSidebar/GitSidebar.css @@ -45,11 +45,6 @@ .git-sidebar-icon-button svg { width: 16px; height: 16px; - pointer-events: none; -} - -.git-sidebar-icon-button svg * { - pointer-events: none; } .git-action-branch-line, diff --git a/src/renderer/styles/global.css b/src/renderer/styles/global.css index eddf4ff..3f61249 100644 --- a/src/renderer/styles/global.css +++ b/src/renderer/styles/global.css @@ -205,6 +205,11 @@ button:disabled { cursor: not-allowed; } +button svg, +button svg * { + pointer-events: none; +} + /* Icon button */ .icon-button { background: transparent; diff --git a/tests/renderer/globalSvgButtonPointerEvents.test.ts b/tests/renderer/globalSvgButtonPointerEvents.test.ts new file mode 100644 index 0000000..c2067ff --- /dev/null +++ b/tests/renderer/globalSvgButtonPointerEvents.test.ts @@ -0,0 +1,13 @@ +import { describe, expect, it } from 'vitest'; +import * as fs from 'node:fs'; +import * as path from 'node:path'; + +describe('Global SVG button pointer-events styles', () => { + const cssPath = path.resolve(__dirname, '../../src/renderer/styles/global.css'); + + it('routes pointer events through buttons instead of nested SVG geometry', () => { + const css = fs.readFileSync(cssPath, 'utf8'); + + expect(css).toMatch(/button\s+svg\s*,\s*button\s+svg\s*\*\s*\{[^}]*pointer-events:\s*none;[^}]*\}/s); + }); +});