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
247 stars 106 forks source link

Antd Select component onMouseDown events should not propagate (or should be configurable) #51

Closed matt-koevort closed 1 year ago

matt-koevort commented 1 year ago

Describe the bug Rendering this component inside another that has a MouseEvent handler causes that handler to fire when the antd Select component's dropdown items are clicked. For ancestors like modals, this causes the modal to close as most modals would have MouseEvent handlers for closing on click outside (see codesandbox).

I have created two separate PRs to address this.

  1. https://github.com/xrutayisire/react-js-cron/pull/49 - provides full control to the user to specify select props for all field types
  2. https://github.com/xrutayisire/react-js-cron/pull/50 - simply ensures that onMouseDown on antd Select components does not propagate the event

To Reproduce Steps to reproduce the behavior:

  1. Use Cron component inside a Modal (our issue is with Sanity modal component)
  2. Select an element from any dropdown/select in the Cron component
  3. The modal will close

Expected behavior Clicking an item in a Select dropdown should not close the modal.

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

CodeSandbox https://codesandbox.io/s/nervous-james-uprzgq?file=/src/App.js

Versions (please complete the following information):

Additional context Add any other context about the problem here.

xrutayisire commented 1 year ago

Hi,

Thank you for the bug report. If you can check up the MRs pipelines and I can release a new version after this!

Thanks a lot!

xrutayisire commented 1 year ago

No activity since Mars and now master changed. If you still need the feature, please update the PRs. Ensure everything is fine and create new PRs. Thanks for the contribution!

vpfaiz commented 5 months ago

This is still an issue. I am trying to use this with Shadcn AlertDialog and the clicks don't register.

xrutayisire commented 5 months ago

Sorry, I don't have time for this PR. You can take the code, update it following the recommendations and I would approve it 🙂