Skip to content

Commit 4500be8

Browse files
refactor: don't update placeholder
1 parent 6a0a839 commit 4500be8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/@react-stately/datepicker/src/useDateFieldState.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export function useDateFieldState<T extends DateValue = DateValue>(props: DateFi
198198
// is controlled, so use the placeholder as the value until all segments are entered so it doesn't
199199
// change from uncontrolled to controlled and emit a warning.
200200
let [placeholderDate, setPlaceholderDate] = useState(
201-
() => createPlaceholderDate(value || props.placeholderValue, granularity, calendar, defaultTimeZone)
201+
() => createPlaceholderDate(props.placeholderValue, granularity, calendar, defaultTimeZone)
202202
);
203203

204204
let val = calendarValue || placeholderDate;
@@ -248,7 +248,6 @@ export function useDateFieldState<T extends DateValue = DateValue>(props: DateFi
248248
if (value !== previousValue && value && Object.keys(validSegments).length <= Object.keys(allSegments).length) {
249249
validSegments = {...allSegments};
250250
setValidSegments(validSegments);
251-
setPlaceholderDate(value);
252251
setPreviousValue(value);
253252
setIsValueConfirmed(true);
254253
}
@@ -296,7 +295,6 @@ export function useDateFieldState<T extends DateValue = DateValue>(props: DateFi
296295
setDate(value);
297296
setIsValueConfirmed(true);
298297
setPreviousValue(value);
299-
setPlaceholderDate(value);
300298
}
301299
};
302300

0 commit comments

Comments
 (0)