From 143ed4a8a4cf6e2486c00f5c595ec6b6b943295f Mon Sep 17 00:00:00 2001 From: SYNITY Date: Mon, 13 Jul 2026 07:23:49 +0700 Subject: [PATCH] fix(bitrix24): make pending-portal delete button clickable in Radix Select [B24:2794] (#1431) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The delete affordance next to each pending portal in the channel-create form was wired to onClick, but Radix Select closes the popover on the SelectItem's own pointerdown handler. By the time the click event would fire on the nested button, the popover — and the button — are gone. onPointerDown on the button additionally called e.preventDefault(), which further blocked the browser from synthesising the click at all. Result: clicking the trash icon looked completely dead. Keyboard users were already covered by the Delete/Backspace onKeyDown handler on the SelectItem itself; only mouse users were locked out. Fire setPendingDeleteName from onPointerDown (with stopPropagation + preventDefault so the parent SelectItem doesn't also select the pending portal), and keep the onClick handler so the button stays activatable by Enter/Space when it takes focus. This mirrors the pattern Radix uses for its own nested interactive elements (e.g. DropdownMenu.CheckboxItem). Surface parity: - Gateway server: N/A because the change is UI-only. - API contract: N/A because bitrix.portals.delete already exists. - Web UI: the single component that owned the broken handler. - CLI/runtime: N/A because no CLI reads this UI state. Co-authored-by: DangTinh311 --- .../src/pages/channels/bitrix24/bitrix-portal-select.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ui/web/src/pages/channels/bitrix24/bitrix-portal-select.tsx b/ui/web/src/pages/channels/bitrix24/bitrix-portal-select.tsx index 980f4b18..e6966aa8 100644 --- a/ui/web/src/pages/channels/bitrix24/bitrix-portal-select.tsx +++ b/ui/web/src/pages/channels/bitrix24/bitrix-portal-select.tsx @@ -150,9 +150,16 @@ export function BitrixPortalSelect({ value, onChange, onCreateRequest, onResumeA type="button" aria-label={t("bitrix24.portalSelect.deleteAria", { name: p.name, defaultValue: `Delete portal ${p.name}` })} className="ml-auto rounded p-1 text-muted-foreground hover:text-destructive" + // Trigger on pointerdown, not click: Radix Select closes + // the popover on the SelectItem's own pointerdown, so + // by the time click fires the item is gone. stopPropagation + // keeps the parent SelectItem from selecting the pending + // portal; the paired click handler stays for keyboard- + // driven activation (Enter/Space on focused button). onPointerDown={(e) => { e.stopPropagation(); e.preventDefault(); + setPendingDeleteName(p.name); }} onClick={(e) => { e.stopPropagation();