Skip to content

Commit

Permalink
fix: remove focus from myinfo child field when form is opened (#6729)
Browse files Browse the repository at this point in the history
* fix: use update instead of append

* fix: use shouldFocus option for append

* fix: remove initialIsOpen for childname dropdown
  • Loading branch information
wanlingt authored Sep 18, 2023
1 parent 5dc4a72 commit 2d75fb4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const ChildrenCompoundField = ({
// Initialize with a single child section
useEffect(() => {
if (!fields || !fields.length) {
append([''])
append([''], { shouldFocus: false })
}
}, [fields, append])

Expand Down Expand Up @@ -295,7 +295,6 @@ const ChildrenBody = ({
items={[childName, ...namesNotSelected()].filter((e) => e !== '')}
value={childName}
isDisabled={isSubmitting}
initialIsOpen={!!myInfoChildrenBirthRecords?.childname}
onChange={(name) => {
// This is bad practice but we have no choice because our
// custom Select doesn't forward the event.
Expand Down

0 comments on commit 2d75fb4

Please sign in to comment.