forge
Explore
Log in

Don't you dare go Hollow

🐛 defer dropdown action to fix SidePanel outside-interaction close, trim question text

Browse files at this commit

bb9d401d7cc58dcfd04db9f16595359c7244df18Burak BoduroğluParent: 2911d65
  • fix
    • 🐛 defer dropdown action to fix SidePanel outside-interaction close, trim question text
Show full message
fix(ui): 🐛 defer dropdown action to fix SidePanel outside-interaction close, trim question text
- wrap dropdown row action in setTimeout(0) so menu closes before panel opens
- add max-w-[24rem] truncation on question text cell
- remove table-fixed from question bank table
src/components/ui/table-row-actions.tsxmodified+5 -1
@@ -33,7 +33,11 @@ export function TableRowActions(props: { label: string; actions: TableRowAction[
3333 class="flex h-10 items-center gap-2.5 rounded-xl px-3 text-xs font-medium"
3434 destructive={action.destructive}
3535 disabled={action.disabled}
36- onSelect={action.onSelect}
36+ // Defer to the next macrotask so the menu fully closes (and
37+ // restores focus to its trigger) before the action opens a
38+ // panel/dialog — otherwise the non-modal SidePanel reads that
39+ // focus-restore as an outside interaction and instantly closes.
40+ onSelect={() => setTimeout(action.onSelect, 0)}
3741 >
3842 {action.icon}
3943 <span>{action.label}</span>
src/pages/question-bank-page.tsxmodified+2 -2
@@ -108,7 +108,7 @@ function QuestionBankContent() {
108108 {
109109 accessorKey: "text",
110110 header: t("questions.text"),
111- cell: (cell) => <p class="truncate font-medium">{cell.row.original.text}</p>,
111+ cell: (cell) => <p class="max-w-[24rem] truncate font-medium">{cell.row.original.text}</p>,
112112 },
113113 {
114114 accessorKey: "kind",
@@ -233,7 +233,7 @@ function QuestionBankContent() {
233233 }
234234 columns={columns()}
235235 data={list()?.items ?? []}
236- tableClass="table-fixed min-w-6xl"
236+ tableClass="min-w-6xl"
237237 filterPlaceholder={t("bank.search")}
238238 searchValue={query()}
239239 onSearchInput={(value) => {