Skip to content

Commit a2a5f5e

Browse files
Merge pull request mui#753 from kitfit-dave/feature/keepCharPositions
Pass keepCharPositions prop to DateInputField
2 parents 1ee7b72 + 8d37529 commit a2a5f5e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/src/_shared/DateTextField.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export interface DateTextFieldProps
102102
/** Input mask, used in keyboard mode read more <a href="https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme">here</a> */
103103
mask?: any;
104104
pipe?: any;
105+
keepCharPositions?: boolean;
105106
onChange: (date: MaterialUiPickersDate) => void;
106107
onClear?: () => void;
107108
/** On/off manual keyboard input mode */
@@ -174,6 +175,7 @@ export class DateTextField extends React.PureComponent<DateTextFieldProps> {
174175
onError: PropTypes.func,
175176
onInputChange: PropTypes.func,
176177
pipe: PropTypes.func,
178+
keepCharPositions: PropTypes.bool,
177179
};
178180

179181
public static defaultProps = {
@@ -204,6 +206,7 @@ export class DateTextField extends React.PureComponent<DateTextFieldProps> {
204206
InputAdornmentProps: {},
205207
adornmentPosition: 'end',
206208
pipe: undefined,
209+
keepCharPositions: false,
207210
};
208211
public static updateState = (props: DateTextFieldProps) => ({
209212
value: props.value,
@@ -342,6 +345,7 @@ export class DateTextField extends React.PureComponent<DateTextFieldProps> {
342345
onClear,
343346
onClick,
344347
pipe,
348+
keepCharPositions,
345349
TextFieldComponent,
346350
utils,
347351
value,
@@ -355,6 +359,7 @@ export class DateTextField extends React.PureComponent<DateTextFieldProps> {
355359
inputProps: {
356360
mask: !keyboard ? null : mask,
357361
pipe: !keyboard ? null : pipe,
362+
keepCharPositions: !keyboard ? null : keepCharPositions,
358363
readOnly: !keyboard,
359364
},
360365
};

0 commit comments

Comments
 (0)