Ticket #149 (closed defect: worksforme)

Opened 3 years ago

Last modified 3 years ago

update() is not consistently called when a form is submitted.

Reported by: mark_ndg Owned by: jf.hovinne
Priority: minor Milestone: 0.5
Component: editor Version: trunk
Keywords: update(), click, onClick, changes not saved, update() not being called Cc:

Description

There seems to be- in my particular case, anyway- some irregularity in the calling of wymeditor.update() when the form is submitted. I have an instance of WYMeditor on the page, and the form submit button is given the default updateSelector class of "wymupdate", and the default updateEvent of "click". Frequently, however, the update() method will not be called prior to the form being submitted, and thus any changes to the text field are not saved to the database. Browsing the forums and various other sites, it appears to me to be an issue with the 'click' event itself, and that 'mousedown' seems to be the preferred updateEvent, as it seems to fire a few milliseconds sooner than 'click'. ('mousedown' fires immediately upon pressing the mouse button, while 'click' does not fire until the button is released, so that is likely the reason for the difference)

I placed an alert('Updated!') directly into the update() method in the wymeditor core JS file, and it does not always appear when the form is submitted. This leads me to conclude that it is the update() method itself that is not firing.

While the occurrence of this issue is seemingly random, I can force it to occur by clearing my browser's cache and refreshing the page before editing and submitting the form.

I am able to resolve the issue by changing the updateEvent binding from 'click' to 'mousedown'; However, if this is indeed an issue with the onClick handler, and is not unique to me, it should possibly changed by default in the core WYMeditor files.

I seem to be alone in experiencing this issue, so it is possible that there is a problem unique to my implementation that I have not yet discovered, but it was suggested that if I was unable to resolve this, I should create a ticket.

My original forum post regarding the issue can be found here:  http://forum.wymeditor.org/forum/viewtopic.php?f=2&t=458&sid=aa64deed5c04b41abd82984e81de6b23

Change History

comment:1 Changed 3 years ago by mark_ndg

There is a related ticket here:  https://trac.wymeditor.org/trac/ticket/150

comment:2 Changed 3 years ago by jf.hovinne

  • Status changed from new to closed
  • Resolution set to worksforme

Please provide a test page in #150, thanks.

Note: See TracTickets for help on using tickets.