Merge pull request 'Date field not cleared in Tenant filter after clicking Clear button' (#432) from Kartik_Bug#1306 into Organization_Management
Reviewed-on: #432 Merged
This commit is contained in:
commit
bbd8ed12f6
@ -38,7 +38,7 @@ const TenantFilterPanel = ({ onApply }) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// ✅ Close popup when navigating to another component
|
// Close popup when navigating to another component
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
handleClosePanel();
|
handleClosePanel();
|
||||||
|
@ -148,10 +148,20 @@ export const DateRangePicker1 = ({
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (defaultRange && resetSignal !== undefined) {
|
if (resetSignal !== undefined) {
|
||||||
|
if (defaultRange) {
|
||||||
applyDefaultDates();
|
applyDefaultDates();
|
||||||
|
} else {
|
||||||
|
setValue(startField, "", { shouldValidate: true });
|
||||||
|
setValue(endField, "", { shouldValidate: true });
|
||||||
|
|
||||||
|
if (inputRef.current?._flatpickr) {
|
||||||
|
inputRef.current._flatpickr.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [resetSignal, defaultRange]);
|
}
|
||||||
|
}, [resetSignal, defaultRange, setValue, startField, endField]);
|
||||||
|
|
||||||
|
|
||||||
const start = getValues(startField);
|
const start = getValues(startField);
|
||||||
const end = getValues(endField);
|
const end = getValues(endField);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user