react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Doesn't work `customInput` with mask when use React 18

Open ilchenkoArtem opened this issue 4 months ago • 3 comments

Describe the bug Can't clear the field when use library of mask when use React 18. The same code works as expected in react 19.

React 19 codesanbox React 18 codesanbox

To Reproduce

  1. Open codesanbox
  2. Focus to field
  3. Clear typed data by keyboard
  4. Blur field

Expected behavior Data in field should be cleared as in react 19

Screenshots If applicable, add screenshots to help explain your problem.

https://github.com/user-attachments/assets/0c9c76d4-853f-48cd-8b95-09aae924185d

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

ilchenkoArtem avatar Aug 20 '25 11:08 ilchenkoArtem

I also checked react-input-mask behavior the same

ilchenkoArtem avatar Aug 22 '25 08:08 ilchenkoArtem

@ilchenkoArtem Please take a look at the value + onRawChange props option:
https://codesandbox.io/p/sandbox/react-datepicker-mask-forked-p7g9ph

mc-petry avatar Aug 22 '25 14:08 mc-petry

@ilchenkoArtem Please take a look at the value + onRawChange props option: https://codesandbox.io/p/sandbox/react-datepicker-mask-forked-p7g9ph

This stops working as soon as rawValue has an initial value: https://codesandbox.io/p/devbox/react-datepicker-mask-forked-xvx28l?workspaceId=ws_A5ZEcXgqNumqhheUh5LgRr

@martijnrusschen Could you pls help with it?

ilchenkoArtem avatar Aug 22 '25 16:08 ilchenkoArtem