From b7819f430a93328505597e47d5863e7d77873f54 Mon Sep 17 00:00:00 2001 From: SemenStruchev <125129104+SemenStruchev@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:49:58 +0200 Subject: [PATCH 1/2] X2-7919 set initial values on datepicker outside click (#287) * set initial values on datepicker outside click * fix lint * fix minor issue --- src/components/DatePicker/DatePickerPopover.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/DatePicker/DatePickerPopover.jsx b/src/components/DatePicker/DatePickerPopover.jsx index 849565d5..0477168f 100644 --- a/src/components/DatePicker/DatePickerPopover.jsx +++ b/src/components/DatePicker/DatePickerPopover.jsx @@ -20,6 +20,7 @@ export const DatePickerPopover = ({ getDayContent, ...rest }) => { + const [initialValue] = useState(value); const [originalValue, setOriginalValue] = useState(value); const [isVisible, setIsVisible] = useState(false); @@ -43,6 +44,10 @@ export const DatePickerPopover = ({ }; const handleClickOutside = () => { + if (!value?.to && variant === "range") { + onChange(initialValue); + } + toggleVisibility(); }; From e488200cac9f97f6f9685e3e9531343e69653e45 Mon Sep 17 00:00:00 2001 From: Manoj Vaibhav Date: Wed, 22 Nov 2023 17:23:05 +0530 Subject: [PATCH 2/2] 2.1.30 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d5c88db..9268059f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@xola/ui-kit", - "version": "2.1.29", + "version": "2.1.30", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@xola/ui-kit", - "version": "2.1.29", + "version": "2.1.30", "license": "MIT", "dependencies": { "@headlessui/react": "^1.4.0", diff --git a/package.json b/package.json index b9f3e5b6..bc428544 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xola/ui-kit", - "version": "2.1.29", + "version": "2.1.30", "description": "Xola UI Kit", "license": "MIT", "files": [