fix(hr): keep input focus while typing in form modal

This commit is contained in:
yotakii
2026-02-23 14:12:32 +03:00
parent 6fada5dd4e
commit 5164f04b66

View File

@@ -305,7 +305,7 @@ function HRContent() {
const totalSalary = employees.reduce((sum, e) => sum + e.baseSalary, 0)
// Render Form Fields Component
const FormFields = ({ isEdit = false }: { isEdit?: boolean }) => (
const renderFormFields = (isEdit = false) => (
<div className="space-y-4 max-h-[60vh] overflow-y-auto pr-2">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
@@ -804,7 +804,7 @@ function HRContent() {
size="xl"
>
<form onSubmit={handleCreate}>
<FormFields />
{renderFormFields()}
</form>
</Modal>
@@ -819,7 +819,7 @@ function HRContent() {
size="xl"
>
<form onSubmit={handleEdit}>
<FormFields isEdit />
{renderFormFields(true)}
</form>
</Modal>