Opened 16 years ago

Closed 11 years ago

#9 closed defect (inactive)

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)

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())) {


[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 (6)

comment:1 Changed 16 years ago by gogo

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

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.

comment:2 Changed 16 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.

comment:3 Changed 16 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:4 Changed 16 years ago by anonymous

  • Cc mokhet@… added

comment:5 Changed 16 years ago by gogo

  • Description modified (diff)
  • Milestone Version 1.0 deleted

comment:6 Changed 11 years ago by gogo

  • Resolution set to inactive
  • Status changed from reopened to closed

4 years, no activity, closing.

Note: See TracTickets for help on using tickets.