Ticket #9 (closed defect: inactive)

Opened 8 years ago

Last modified 4 years ago

Work around the "get stuck in tags" problem.

Reported by: gogo Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords:
Cc: mokhet@…

Description (last modified by gogo) (diff)

Bruce Webster writes:


[Getting stuck inside tags is] my current problem too (and last on my list of improvements I need to make to htmlarea) - did you find any way to fix it? I'm going to try and stick an   after new tag blocks or something, but that is easier said than done!


I had added something to insert a non breaking space after certain tags, Bruce found it had some problems and submits this alternative.


//whack a non-breaking space after new formatblocks - to stop cursor
getting stuck inside them!
//doesn't work if you had multiple blocks selected when applying the
new formatblock
     var blocktag = editor.getParentElement();
     if (blocktag.tagName.toLowerCase()==(HTMLArea.is_ie?
param.toLowerCase().replace(/[<>]/g,'') : param.toLowerCase())) {

        blocktag.parentNode.insertBefore(editor._doc.createTextNode('\xA0'),
blocktag.nextSibling);
     }

[It] goes straight after the long switch (cmdID) statement in HTMLArea.prototype.execCommand function. This fixes our problem with new block styles (applied by the styles menu (h1..h6, normal, address, etc)).


This is a bit of a kludgy solution overall, we should see if any better way can be found.

Change History

Changed 8 years ago by gogo

  • status changed from new to closed
  • resolution set to fixed

See changeset:12

I didn't use the code in this ticket, it now inserts a Unicode hair-width-space character immediatly after the "focused" element when the cursor is at the end of the element, and there are no text nodes immediatly after the element (siblings thereof).

This makes it easier to navigate "around" elements and stops you getting stuck inside them.

Comments on the use of the Unicode character rather than a normal space are welcome, perhaps it creates a problem?

Currently gecko only, do we need to make this work for IE or is the IE default behaviour ok?

Resolving fixed for now, re-open if it needs to be.

Changed 8 years ago by holtwickd

For me it seems to create new problems. If you insert some lines of text in Mozilla and then set the cursor by mouse on other positions then new blank lines are created, even if they are not visible in the HTML sourcecode.

Changed 8 years ago by anonymous

  • status changed from closed to reopened
  • resolution deleted

Changed 8 years ago by anonymous

  • cc mokhet@… added

Changed 8 years ago by gogo

  • description modified (diff)
  • milestone deleted

Changed 4 years ago by gogo

  • status changed from reopened to closed
  • resolution set to inactive

4 years, no activity, closing.

Note: See TracTickets for help on using tickets.