fix(hr): keep input focus while typing in form modal
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user