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: Allowing DatePicker to be focusable within FocusZones by default.",
"packageName": "@fluentui/react",
"email": "humberto_makoto@hotmail.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ export const DatePickerBase: React.FunctionComponent<IDatePickerProps> = React.f
textFieldProps && textFieldProps.id && textFieldProps.id !== id ? textFieldProps.id : id + '-label';
const readOnly = !allowTextInput && !disabled;

const dataIsFocusable = (textFieldProps as any)?.['data-is-focusable'] ?? (props as any)['data-is-focusable'] ?? true;

return (
<div {...nativeProps} className={classNames.root} ref={forwardedRef}>
<div ref={datePickerDiv} aria-owns={isCalendarShown ? calloutId : undefined} className={classNames.wrapper}>
Expand All @@ -471,6 +473,7 @@ export const DatePickerBase: React.FunctionComponent<IDatePickerProps> = React.f
tabIndex={tabIndex}
readOnly={!allowTextInput}
{...textFieldProps}
data-is-focusable={dataIsFocusable}
id={textFieldId}
className={css(classNames.textField, textFieldProps && textFieldProps.className)}
iconProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ exports[`DatePicker renders DatePicker allowing text input correctly 1`] = `
@media screen and (-ms-high-contrast: active), screen and (forced-colors: active){&::-ms-input-placeholder {
color: GrayText;
}
data-is-focusable={true}
id="DatePicker0-label"
onBlur={[Function]}
onChange={[Function]}
Expand Down Expand Up @@ -390,6 +391,7 @@ exports[`DatePicker renders DatePicker with value correctly 1`] = `
overflow: hidden;
text-overflow: ellipsis;
}
data-is-focusable={true}
id="DatePicker0-label"
onBlur={[Function]}
onChange={[Function]}
Expand Down Expand Up @@ -622,6 +624,7 @@ exports[`DatePicker renders default DatePicker correctly 1`] = `
overflow: hidden;
text-overflow: ellipsis;
}
data-is-focusable={true}
id="DatePicker0-label"
onBlur={[Function]}
onChange={[Function]}
Expand Down