primevue icon indicating copy to clipboard operation
primevue copied to clipboard

DatePicker: Clear button not working

Open borsTiHD opened this issue 7 months ago • 2 comments

Describe the bug

The clear button in the DatePicker component is not resetting the selected date.

Pull Request Link

fix(DatePicker): update clear button to use defaultValue instead of formDefaultValue #7736

Reproducer

https://primevue.org/datepicker/#button

Environment

Latest PrimeVue 4.3.4

Vue version

3

PrimeVue version

4.3.4

Node version

22.15.0

Browser(s)

Chrome

Steps to reproduce the behavior

Use DatePicker with "showButtonBar" and try to click on the "clear" button.

Expected behavior

It should clear the input field.

borsTiHD avatar May 20 '25 10:05 borsTiHD

Any chance this is going to be merged soon?

livanovvisma avatar Jun 10 '25 05:06 livanovvisma

Waiting for this too

guillaume-bonnefoy avatar Jun 18 '25 10:06 guillaume-bonnefoy

Waiting for this too!

rogerhoen avatar Jul 03 '25 11:07 rogerhoen

Waiting for this too!

yuxinli915 avatar Jul 04 '25 14:07 yuxinli915

We experienced this issue as well and had to downgrade to the following versions:

"primevue": "4.3.3",
"@primeuix/themes": "1.0.3"

latin-panda avatar Jul 12 '25 10:07 latin-panda

Waiting for it too. Would be great if the clear button works as expected. On the usability site it is useless like this

msg-jstren avatar Aug 01 '25 07:08 msg-jstren

We'll discuss for 4.3.10, thank you for the feedback.

cagataycivici avatar Sep 08 '25 15:09 cagataycivici

We'll discuss for 4.3.10, thank you for the feedback.

Please do that, but what's the hold-up? I'm waiting for the fix.

It's not that I want my change included. The change is so simple that there are certainly better ways to do it.

borsTiHD avatar Sep 09 '25 12:09 borsTiHD

I'm waiting for the fix too.

As a temporary solution, I created a wrapper component around the DatePicker, where I access the clear button and its actionCallback using named templates.

I wrote my own onClear function, which clears the input model and then triggers the native actionCallback (to close the dropdown).

kosta-j avatar Sep 09 '25 16:09 kosta-j

Thanks for fixing but we could really do with a release now...

james-onpoint avatar Sep 27 '25 19:09 james-onpoint