xrutayisire / react-js-cron

A React cron editor built with antd
https://xrutayisire.github.io/react-js-cron/?path=/docs/reactjs-cron--demo
MIT License
249 stars 106 forks source link

Strange behavior when clicking fast on hour picker #12

Closed vdineva closed 2 years ago

vdineva commented 2 years ago

Describe the bug Strange behavior when clicking fast on hour picker

To Reproduce Steps to reproduce the behavior:

  1. Go to the demo site: https://xrutayisire.github.io/react-js-cron/?path=/docs/reactjs-cron--demo
  2. Click on hour picker
  3. Select any value from the list
  4. Click to unselect it and click fast to select it again (please see attached video)

Expected behavior Only the selected hour is selected

Video recording

https://user-images.githubusercontent.com/791418/144268993-033744e6-2697-44b3-93ce-6f38ca196004.mov

xrutayisire commented 2 years ago

Hello,

Thanks for the issue. That's a feature actually 😁 As you can see on the demo, there is an info about this: "Double click on a dropdown option to automatically select / unselect a periodicity". If you want a cron to run each 2 minutes, just double click on 2.

It's a feature I wanted to keep from "jqCron": https://jqcron.arnapou.net/demo/?page=demo_7

Do you want a new prop to be able to disable this feature? It would be activated by default to prevent a breaking change.

vdineva commented 2 years ago

Yes - I think an option to disable this feature would make sense. I found it counter-intuitive and thought it's a bug :)

xrutayisire commented 2 years ago

That's a good idea, I agreed 👍

I will create a new version for this new prop.

vdineva commented 2 years ago

Thank you @xrutayisire for the quick implementation! When can we expect the new version?

xrutayisire commented 2 years ago

Hello,

I can publish it right now, just to be sure before. Can you quickly tell me if it's all good for you like this?

Demo: https://xrutayisire.github.io/react-js-cron/?path=/story/reactjs-cron--no-periodicity-on-double-click

vdineva commented 2 years ago

Yes - it's looking good! Thank you very much

xrutayisire commented 2 years ago

New release 1.3.0 is out with the new property 🥳