Example of Confirm Cancellation bug

Example of Confirm Cancellation bug

dan@19ideas.comdan@19ideas.com Posts: 56Questions: 13Answers: 1

I wanted to implement a feature shown on this example here:

https://editor.datatables.net/examples/api/confirmClose.html

When creating a new form, and clicking outside of the box, you have to click "ok" or "cancel" 3 to 4 times.
When editing the form on non-number fields, like First name or Last name, you have to click "ok" or "cancel" 2 times.

Is there a fix for this in the works?

Replies

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @dan@19ideas.com,

    I just tried it on that link you posted, and it all behaves as expected there. Would you be able to link to a page that exhibits the error or be able to create a fiddle that shows instead, please?

    Cheers,

    Colin

  • dan@19ideas.comdan@19ideas.com Posts: 56Questions: 13Answers: 1

    Hi colin, I didn't create a page, I was just using the example displayed. I was able to repeat the problem and did enough testing to find out why I get the problem.

    To replicate,

    1. click the New button,

    2. enter a value for any of the fields

    3. click out side the pop up, and click "ok"

    When following the first three steps the first time, this works. But without refreshing the page, if you do it again, the number of times you have to click "ok" goes up by 1.

    I never clicked the "create" button. I just wanted to test the functionality of what happens when you enter dirty data and try to leave the form.

    Again, this is happening to me on the example page.

  • allanallan Posts: 63,506Questions: 1Answers: 10,471 Site admin

    Hi Dan,

    Thanks for letting us know about that and the steps to reproduce the issue. I missed the close event from the list of events which should trigger the editor.off(...) call. Adding that in, allows it to work as expected. I've updated the example (depending on browser cache, you may need to refresh to see it).

    Allan

This discussion has been closed.