Example of Confirm Cancellation bug
Example of Confirm Cancellation bug
dan@19ideas.com
Posts: 56Questions: 13Answers: 1
in Editor
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?
This discussion has been closed.
Replies
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
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,
click the New button,
enter a value for any of the fields
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.
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 theeditor.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