ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

IcChange event not emitted from date picker when date not within allowed range

Open GCHQ-Developer-847 opened this issue 10 months ago • 0 comments

Summary of the bug

On the date picker component, if you select a date which is not within the allowed range (i.e. when max, min, disablePast or disableFuture has been set), the icChange event is not emitted.

Raised by a customer (split out from #3063) - emitting icChange even when the date is not within the allowed range is needed for them as they want to validate the value themselves and update their custom validation message.

🪜 How to reproduce

  1. Go to this StackBlitz which shows three date pickers - the first uses min and max, the second disablePast and the third disableFuture.
  2. Type in dates which are outside of the allowed range of dates.
  3. See that icChange is not emitted (logged to the console). It is only emitted when the date is within the allowed range.

🧐 Expected behaviour

It would be useful if the icChange event gets emitted even when the date is not one which is allowed to accommodate for custom validation handling.

Note: icChange firing when invalid dates are chosen should be a prop that's disabled by default because it's only of benefit to users making external validation.

GCHQ-Developer-847 avatar Feb 27 '25 14:02 GCHQ-Developer-847