Native browser undo doesn't work in Safari 3

dww - June 1, 2009 - 03:49
Project:BUEditor
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

I found and read #119913: Support for undo, where you wrote:

Most browsers(at least IE and FF) natively support undo/redo for textareas. It's not very feasible to track changes and save an extra undo history when there is already one.

I just tried this on my Mac, and while the native browser undo works fine in FF, it's broken in Safari (3.2.3). Something about how bueditor inserts the text confuses Safari which doesn't count this as "typing" and therefore there's nothing to undo. :( I know Safari can be a pain when it comes to JS support -- often times things that work fine in FF don't quite work in Safari.

I don't really know enough to debug it further, but I wanted to open an issue about it (didn't seem like it was worth re-opening #119913 for this). It's hard to call this issue a "bug", since it's more likely a Safari bug than a bueditor bug, but it's functionality that doesn't work, so let's call it a bug. ;)

Let me know if I can provide any additional information or aid in debugging.

Thanks!
-Derek

#1

ufku - June 1, 2009 - 13:15

When it comes to textarea history, i think the only browser that handles it properly is Firefox.
I tested a few browsers focusing on two parameters.
1- Per-textarea history. (This is important when there are multiple textareas on the page.)
2- Content by js. (textarea.value = 'some text')

FF 3
- history is per-textarea
- Content by js is just like content by hand which is tracked.

IE 7
- history is not per-textarea. When you hit ctrl-z it may undo some changes in another textarea.
- Content by js is just like content by hand which is tracked.

Opera 9.6
- history is per-textarea.
- Content by js deletes history. Impossible to undo.

Safari 4 beta
- history is not per-textarea. When you hit ctrl-z it may undo some changes in another textarea.
- Content by js deletes history. Impossible to undo.

It seems to me that Opera and Safari are doing something like setting the content using innerHTML.
Comparing textarea.value = 'some text' with textarea.innerHTML = 'some text' in IE showed that the result of the latter is loss of history just like in Safari and Opera.

#2

dww - June 1, 2009 - 15:41

Thanks for the investigation! Bummer about the results. Does that mean we should re-open #119913: Support for undo and add bueditor-provided per-textarea history undo? ;)

#3

ufku - June 1, 2009 - 15:57

Yes, definitely.

#4

dww - June 1, 2009 - 16:06
Status:active» won't fix

Cool, thanks. #119913-3: Support for undo

 
 

Drupal is a registered trademark of Dries Buytaert.