Open VedantSG123 opened 4 months ago
Hi,
I saw two different things in your issue:
[bug] allowEmpty='never'
should return an error if cron value equals * * * * *
Clearly there is a bug here, allowEmpty='never'
should never allow * * * * *
as a cron value, and should return an error.
A fix is needed
[enhancement] Add, allowEmpty
support in dropdownsConfig
Today, you would not have been able to do exactly what you want, with or without the bug. If you want to allowEmpty='never'
for specifically one dropdown, it's not possible. Also, I see that you may not only want an error returned but a fallback to a default value. That is not supported.
I don't have the time to work on this library these days, but I would be happy to review a PR that fix the bug and add the new feature you would like.
Note that dropdownsConfig
prop first need a fix to prevent an infinite loop: https://github.com/xrutayisire/react-js-cron/issues/67
allowEmpty
not working properly A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I want to restrict the user from setting the cron value to '*
' in a particular dropdown.Current Behaviour: If the user deselects all the values from the dropdown, it sets the value of that dropdown to '
*
'https://github.com/xrutayisire/react-js-cron/assets/103552663/4c2b179b-279a-47c8-9798-6edacf7afff2
I don't want the value to become
*
when user deselects all the values from the hour dropdown, instead set it to some default value (not *).Here is what I tried to do:
But is not working properly, here is the attached screen record:
Screencast from 2024-06-27 10-56-27.webm
When I click on the default value itself, the expression is fine, but the change dosen't reflect on the drop-down, it still shows every hour in the dropdown