Bug 172978 - RTE: Can't delete an item which has a hyper-link by 'Backspace'
Summary: RTE: Can't delete an item which has a hyper-link by 'Backspace'
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EPF (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P5 normal (vote)
Target Milestone: ---   Edit
Assignee: epf.tool-inbox CLA
QA Contact: wang jun CLA
URL:
Whiteboard: RTE
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-05 21:29 EST by Yang Zhao Hui CLA
Modified: 2023-02-16 16:16 EST (History)
4 users (show)

See Also:


Attachments
patch for fix (1.05 KB, patch)
2007-02-06 22:11 EST, Jeff Hardy CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yang Zhao Hui CLA 2007-02-05 21:29:37 EST
Using 'Backspace' key, we can not delete a pure linked item in RTE. 

Steps To Reproduce:
1. Create a new method element, e.g., a new role
2. DnD itself into the MainDescription area, save all and close the role's editor
3. Reopen the role's editor, select the "Role: New Role" item in MainDescription area, and using 'Backspace' to delete the it.
-->Problem: no dirty flag for the editor
4. Close the editor and reopen it
-->Problem: the linked item is still in here


More information:
1. Not a regression, found in windows
2. This problem also for the other kinds of hyper-link, such as "http://www.google.com"
3. Only for 'Backspace', the using of 'Delete' or mouse cut/delete will not meet this problem
4. Only for a pure linked item, if you select the linked content merged with some pure text, and do the 'Backspace', the problem will not rise.
Comment 1 Jeff Hardy CLA 2007-02-06 22:11:04 EST
Created attachment 58406 [details]
patch for fix

the RTE's javascript was telling it to check for modification before the browser actually did the backspace.  Set a 10 ms timeout for the modification check, and also did the same for the Ctrl+Z (Undo) command.
Comment 2 Jeff Hardy CLA 2007-02-07 14:04:18 EST
patch applied
Comment 3 wang jun CLA 2007-02-09 00:11:53 EST
It seem that this problem is not fix complete.

Steps To Reproduce:
1. Create a new method element, e.g., a new role
2. DnD itself into the MainDescription area, save all and close the role's
editor
3. Reopen the role's editor, select the "Role: New Role" item in
MainDescription area, and using 'Backspace' to delete the it.
4. Close the editor and reopen it
-->Problem: The linked item is still in here.
5. Check the HTML code in RTE editor of role
-->Problem: A "&nbsp;" was added after the closed tag link </a>
6. Close the RTE editor and return role's editor
7. Select the link "Role: New Role" item in
MainDescription area, and using 'Backspace' to delete the it
-->Result: The link item is delete complete.


Comment 4 Yang Zhao Hui CLA 2007-02-09 02:59:20 EST
Reopen this according to wang jun's descritption
Comment 5 Jeff Hardy CLA 2007-02-09 16:32:01 EST
This problem is caused by the UI's use of the FocusLost event to determine when to update the underlying model.

When you delete the link, the editor gets marked dirty, however the model is not updated until the focusLost event is fired by the RTE.  Clicking the 'X' on the editor tab to close it does not cause this focusLost event to fire, so the model is not updated.

The best way to fix this is to change the focusLost listeners to use some other event that is more reliable.  
Comment 6 wang jun CLA 2007-07-25 23:37:01 EDT
Can't reproduce this problem on EPF 1.2 build 20070724 and closed.
Comment 7 Eclipse Webmaster CLA 2009-08-30 02:48:40 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.