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