Skip to content

Commit

Permalink
fix: change logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Dec 11, 2023
1 parent dd3498e commit efa85e8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/NewPicker/PickerInput/SinglePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ function Picker<DateType extends object = any>(
defaultValue,
value,
needConfirm,
onChange,

// Disabled
disabled,
Expand Down Expand Up @@ -266,13 +267,23 @@ function Picker<DateType extends object = any>(

// ======================== Value =========================
// TODO: Fix submit logic

const onInternalChange: PickerProps['onChange'] =
onChange &&
((dates, dateStrings) => {
onChange(pickerParam(dates), pickerParam(dateStrings));
});

const [
/** Trigger `onChange` by check `disabledDate` */
flushSubmit,

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable flushSubmit.
/** Trigger `onChange` directly without check `disabledDate` */
triggerSubmitChange,
] = useRangeValue(
filledProps,
{
...filledProps,
onChange: onInternalChange,
},
mergedValue,
setInnerValue,
getCalendarValue,
Expand Down

0 comments on commit efa85e8

Please sign in to comment.