Merge pull request 'fix: close modal popups only on overlay mousedown' (#18) from fix/modal-mousedown-overlay-close into main

Reviewed-on: #18
This commit was merged in pull request #18.
This commit is contained in:
2026-04-15 14:02:52 +00:00
5 changed files with 34 additions and 12 deletions

View File

@@ -15,13 +15,15 @@ family_budget/
## Tech stack
| Layer | Choice | Rationale |
|---------- |------------------------|--------------------------------------------------------|
| Backend | Express + TypeScript | Simple, well-known, sufficient for a small local app |
| Frontend | React + Vite + TS | Fast dev experience, modern tooling |
| Database | PostgreSQL | Deployed on Synology NAS |
| Migrations | Knex | Lightweight, SQL-close, supports seeds |
| Shared | Pure TypeScript types | Zero-runtime, imported by both backend and frontend |
| Layer | Choice | Rationale |
| ---------- | --------------------- | ---------------------------------------------------- |
| Backend | Express + TypeScript | Simple, well-known, sufficient for a small local app |
| Frontend | React + Vite + TS | Fast dev experience, modern tooling |
| Database | PostgreSQL | Deployed on Synology NAS |
| Migrations | Knex | Lightweight, SQL-close, supports seeds |
| Shared | Pure TypeScript types | Zero-runtime, imported by both backend and frontend |
## Prerequisites
@@ -39,4 +41,4 @@ npm install
npm run build -w shared
```
See `backend/README.md` and `frontend/README.md` for per-package instructions.
See `backend/README.md` and `frontend/README.md` for per-package instructions.

View File

@@ -31,7 +31,12 @@ export function ClearHistoryModal({ onClose, onDone }: Props) {
};
return (
<div className="modal-overlay" onClick={onClose}>
<div
className="modal-overlay"
onMouseDown={(e) => {
if (e.target === e.currentTarget) onClose();
}}
>
<div className="modal" onClick={(e) => e.stopPropagation()}>
<div className="modal-header">
<h2>Очистить историю операций</h2>

View File

@@ -31,7 +31,12 @@ export function DeleteImportModal({ imp, onClose, onDone }: Props) {
};
return (
<div className="modal-overlay" onClick={onClose}>
<div
className="modal-overlay"
onMouseDown={(e) => {
if (e.target === e.currentTarget) onClose();
}}
>
<div className="modal" onClick={(e) => e.stopPropagation()}>
<div className="modal-header">
<h2>Удалить импорт</h2>

View File

@@ -82,7 +82,12 @@ export function EditTransactionModal({
};
return (
<div className="modal-overlay" onClick={onClose}>
<div
className="modal-overlay"
onMouseDown={(e) => {
if (e.target === e.currentTarget) onClose();
}}
>
<div className="modal" onClick={(e) => e.stopPropagation()}>
<div className="modal-header">
<h2>Редактирование операции</h2>

View File

@@ -59,7 +59,12 @@ export function ImportModal({ onClose, onDone }: Props) {
};
return (
<div className="modal-overlay" onClick={onClose}>
<div
className="modal-overlay"
onMouseDown={(e) => {
if (e.target === e.currentTarget) onClose();
}}
>
<div className="modal" onClick={(e) => e.stopPropagation()}>
<div className="modal-header">
<h2>Импорт выписки</h2>