AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

Clicking Cancel doesn't restore original value #63

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load demo page on this site. 
2. Edit the first demo to add text to the end of the content.
3. Click Cancel.

What is the expected output? What do you see instead?

Expected: The content reverts to it's previous original value.
Actual: The added text remains visible as though the edit was saved.

What version of the product are you using? On what operating system?

 The latest release. This issue is also visible on the demo page on this site.

Please provide any additional information below.

 The bug seems to be around line 383, where handleCancelEditor replaces the originalValue with the editedText. I'm not sure why it does this in the cancellation function, and cannot find documentation as to the reasoning.

Original issue reported on code.google.com by r...@ryanabrams.net on 12 Jul 2010 at 6:27

GoogleCodeExporter commented 8 years ago
Forgot to mention, this is on Mac OS X on Safari 5. I've not yet tested in 
other browsers.

Original comment by r...@ryanabrams.net on 12 Jul 2010 at 6:28

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
yep, i confirm this bug. (Chrome\Firefox + win7)

Original comment by b3at...@gmail.com on 27 Sep 2010 at 1:37

GoogleCodeExporter commented 8 years ago
What is the status of this being fixed? I can't use this code for my client 
until it works properly.

Original comment by vfurlen...@gmail.com on 7 Oct 2010 at 7:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hello everbody,

  In advance, sorry for my english.

  This bug is still not resolved in 2.2, but I took a look around the cancel code and I found a simple workaround, hope this will help :)

=> In the handleCancelEditor method, the 'cancel' behavior was intended to 
happen:

  this.restoreOriginalValue(); 

but then, for some reason, comes this:

  if (hasContent(enteredText) 
      && ! this.isDisabledDefaultSelectChoice())
    this.setClosedEditorContent(enteredText);

which erases original value with entered text if value was modified and if the 
input is 'not a' select with first item selected and disabled (??) I don't 
understand why this check occurs, but it clearly inhibits the 'restore' 
behavior.

My opinion is that this lib's developer should shunt this test if input is not 
a select - But still, you can modify yourself ;) - :

  if (hasContent(enteredText) 
    && this.settings.field_type == 'select'
    && !this.isDisabledDefaultSelectChoice())
      this.setClosedEditorContent(enteredText);

Have fun with this lib which is, except this bug, pretty good :)
Bye.

Original comment by shae.oul...@gmail.com on 15 Dec 2010 at 7:46

GoogleCodeExporter commented 8 years ago
I'm stumped, I cannot yet reproduce this in my tests. Working on it...

Original comment by mhaec...@gmail.com on 27 Jan 2011 at 9:14

GoogleCodeExporter commented 8 years ago
Indeed, I didn't have a single testcase that required this reset - so its most 
probably just wrong. I have no idea anymore why I put it there. Ahem.

Well, fixed now. I'll release 2.2.2 as soon as I've got through the rest of the 
bug reports.

Original comment by mhaec...@gmail.com on 27 Jan 2011 at 9:18