Karibu _setValue not Throwing exception when invalid Date is selected

In the documentation it is noted correctly, that trying to set a value on a hidden or read only component throws an exception.
I would have honestly guessed, that setting a value that lies outside the min and max date would also throw an exception, as this is kind of the same thing. On the server you could set the value even when the component is read only / not visible or if the date lies outside the specified range. But the user can not do the same thing in neither of the cases. Karibu presents us with a weird third behaviour where it is impossible to set a date on a read-only / not visible field. But it is visible to set a date that lies outside the specified range.

TLDR: karibus _setValue should throw exception when given date is outside valid range.

2 Likes

If you have a feature request for Karibu - wouldn’t it be best to open that feature request in the GitHub repository of Karibu?

1 Like

@knoobie I thought that this was the replacement for the discord chat, and that it would be better to discuss it here first, so that the github project is not flooded with requests. but I will go ahead and make a feature request.
Should I add a feature issue here: Issues · mvysny/karibu-testing · GitHub ?

The DatePicker is very special. Most validation is happening in the browser side.

Don’t blame Karibu. It’s running on the server side.

1 Like

I don’t think the maintainer of Karibu is reading the forum but he will check the issue on github.

But as Simon says the min/max value validation of the date picker is happening on the client side so I don’t think Karibu can do anything about it.

Ping @mavi1
I saw him active on the forum recently

1 Like

Hi, yup, please open a feature request at Issues · mvysny/karibu-testing · GitHub . As @SimonMartinelli mentioned, Karibu doesn’t run client-side validations, but maybe _setValue() could have a special support for DatePicker?

That being said, the DatePicker client-side validation can potentially be bypassed by an attacker. It is always recommended to have a server-side validation as well; that kind of validation is then correctly triggered by Karibu-Testing.

However, please open a bug report/feature request: we can discuss the topic there, and even if we decide not to support the client-side validation, I’ll at least update the documentation to state this.

1 Like