Skip to content

Commit 5c33418

Browse files
committed
Rename keyboardIcon prop to openPickerIcon #1693
The prop should be named after the icon's functionality/usage. The new name matches the `hideOpenPickerButton` prop. The documentation on the prop already matches this wording. Tested by verifying that the two affected demo pages still work and show the customized icon.
1 parent 95becb3 commit 5c33418

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

docs/pages/demo/datepicker/AdvancedKeyboard.example.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function AdvancedKeyboardExample(props) {
1717
dateFns: 'yyyy/MM/dd',
1818
})}
1919
mask="____/__/__"
20-
keyboardIcon={<EventNoteIcon />}
20+
openPickerIcon={<EventNoteIcon />}
2121
value={selectedDate}
2222
onChange={date => handleDateChange(date)}
2323
/>

docs/pages/demo/datetime-picker/CustomDateTimePicker.example.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function CustomDateTimePicker(props) {
2525
rightArrowIcon={<SnoozeIcon />}
2626
leftArrowButtonText="Open previous month"
2727
rightArrowButtonText="Open next month"
28-
keyboardIcon={<ClockIcon />}
28+
openPickerIcon={<ClockIcon />}
2929
minTime={new Date(0, 0, 0, 9)}
3030
maxTime={new Date(0, 0, 0, 20)}
3131
/>

docs/prop-types.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/TimePicker/TimePicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function useDefaultProps({
3838
acceptRegex: willUseAmPm ? /[\dapAP]/gi : /\d/gi,
3939
mask: mask || willUseAmPm ? '__:__ _M' : '__:__',
4040
getOpenDialogAriaText: getTextFieldAriaText,
41-
keyboardIcon: <ClockIcon />,
41+
openPickerIcon: <ClockIcon />,
4242
inputFormat: pick12hOr24hFormat(inputFormat, ampm, {
4343
localized: utils.formats.fullTime,
4444
'12h': utils.formats.fullTime12h,

lib/src/_shared/KeyboardDateInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const KeyboardDateInput: React.FC<DateInputProps & DateInputRefs> = ({
3131
disabled,
3232
rifmFormatter,
3333
TextFieldComponent = TextField,
34-
keyboardIcon = <CalendarIcon />,
34+
openPickerIcon = <CalendarIcon />,
3535
variant,
3636
emptyInputText: emptyLabel,
3737
disableOpenPicker: hideOpenPickerButton,
@@ -127,7 +127,7 @@ export const KeyboardDateInput: React.FC<DateInputProps & DateInputRefs> = ({
127127
{...KeyboardButtonProps}
128128
onClick={onOpen}
129129
>
130-
{keyboardIcon}
130+
{openPickerIcon}
131131
</IconButton>
132132
</InputAdornment>
133133
),

lib/src/_shared/PureDateInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface DateInputProps<TInputValue = ParsableDate, TDateValue = Materia
2626
*/
2727
emptyInputText?: string;
2828
/** Icon displaying for open picker button */
29-
keyboardIcon?: React.ReactNode;
29+
openPickerIcon?: React.ReactNode;
3030
/**
3131
* Custom mask. Can be used to override generate from format. (e.g. __/__/____ __:__)
3232
*/
@@ -102,7 +102,7 @@ export const PureDateInput: React.FC<DateInputProps & DateInputRefs> = ({
102102
TextFieldComponent = TextField,
103103
variant,
104104
emptyInputText: emptyLabel,
105-
keyboardIcon,
105+
openPickerIcon,
106106
disableOpenPicker: hideOpenPickerButton,
107107
ignoreInvalidInputs,
108108
KeyboardButtonProps,

0 commit comments

Comments
 (0)