Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix: Remove focus function from the deps to avoid constant move of focus.",
"packageName": "@fluentui/react-datepicker-compat",
"email": "esteban.230@hotmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ export const useDatePicker_unstable = (props: DatePickerProps, ref: React.Ref<HT
if (!open && !props.disabled) {
focus();
}
}, [open, props.disabled, focus]);
// Focus function keeps changing, so we need to skip it in the deps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open, props.disabled]);

const calendarShorthand = resolveShorthand(props.calendar, {
required: true,
Expand Down