Opened 16 years ago

Closed 13 years ago

#1996 closed Bug (worksforme)

Insert new line before Select Box, unpredictable behavior.

Reported by: William Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.4.3
Keywords: Cc:

Description (last modified by Frederico Caldeira Knabben)

In firefox, select boxes behave very unpredictably when you try to insert a new line/paragraph before them.

The unusual behavior/broken code is always preceded by the cursor disappearing. When the cursor disappears, typing, results in text showing up in the select box(this is probably a bug as well), but this is not reflected in the code. Pressing enter on the other hand, breaks the code.

There are 3 different behaviors that pressing the enter key might have and which one will happen is somewhat unpredictable, but here are a few examples of how it might go down.

I've tested this both in 2.6B and nightly build.

Scenario 1

  1. Paste the following HTML:
<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p><select name="adsf">
    <option value="asdf">adsf</option>
    </select></p>
    <p>&nbsp;&nbsp;</p>
</form>
<p>&nbsp;</p>
  1. Place cursor on the line below the select box.
  2. Press up arrow (the cursor will disappear?)
  3. Press Enter

And the code becomes

<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p><select name="adsf">'''</select><select name="adsf">'''
    <option value="asdf">adsf</option>
    </select></p>
    <p>&nbsp;&nbsp;</p>
</form>
<p>&nbsp;</p>

Scenario 2

  1. Paste the following HTML:
<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p><select name="adsf">
    <option value="asdf">adsf</option>
    </select></p>
    <p>&nbsp;&nbsp;</p>
</form>
<p>&nbsp;</p>
  1. Place the cursor below the select box
  2. Press the left arrow. (the cursor will now be at the end of the select box press enter now, and you get a new paragraph expected)
  3. Press the left arrow again. (the cursor will disappear?)
  4. Press enter.

The code becomes

<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p>'''<select name="adsf"></select>'''</p>
    <p>&nbsp;&nbsp;</p>
</form>
<p>&nbsp;</p>

Scenario 3

  1. Paste the following HTML:
<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p><select name="adsf">
    <option value="asdf">adsf</option>
    </select></p>
    <p>&nbsp;&nbsp;</p>
</form>
<p>&nbsp;</p>
  1. Place the cursor above the select box
  2. Press the right arrow. (the cursor will disappear?)
  3. Press enter.

The code becomes

'''<p>&nbsp;</p>'''
<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p><select name="adsf">
    </select></p>
    <p>&nbsp;</p>
</form>
<p>&nbsp;</p>

Change History (4)

comment:1 Changed 16 years ago by Wojciech Olchawa

Component: Core : Output DataGeneral
Keywords: Confirmed added; select removed
Summary: [FF] Insert new line before Select Box, unpredictable behavior.Insert new line before Select Box, unpredictable behavior.
Version: FCKeditor 2.6 Beta

Scenario 1 - Confirmed using 2.6 beta and SVN version in FF2, in IE the cursor disappears as well, the only possibility to place the cursor to the right of the select box is by clicking on the right side of it. It's impossible to do it using the key arrows.

Scenario 2 - Confirmed using 2.6 beta and SVN version in FF2, OK with IE

Scenario 3 - Confirmed using 2.6 beta and SVN version in FF2 but with a result similar to the one in Scenario 1 :

<p>&nbsp;This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>
<form method="get" action="asd" name="asdf">
    <p>&nbsp;&nbsp;</p>
    <p><select name="adsf"></select><select name="adsf">
    <option value="asdf">adsf</option>
    </select></p>
    <p>&nbsp;&nbsp;</p>
</form>
<p>&nbsp;</p>

comment:2 Changed 16 years ago by Frederico Caldeira Knabben

Description: modified (diff)

Formatted the description a bit. I've left the ''' marks to identify the buggy points, even if there is no bold in the code blocks.

comment:3 Changed 16 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.8
Version: FCKeditor 2.6 BetaFCKeditor 2.4.3

Unfortunately browsers are still buggy to handle form elements in an editing. Actually, it seems to be less interest on supporting them well, as their usage is quite restrict.

This fact makes things a bit hard for us, as we are not dealing with our own bugs, but with browser weirdnesses. We must weight the possibilities of having it fixed by measuring the usefulness of it in the real world, and then understanding the amount of overhead that such fix would bring to our code. Things must be well equilibrated in this sense.

Let's think about it for the 2.8.

comment:4 Changed 13 years ago by Krzysztof Studnik

Resolution: worksforme
Status: confirmedclosed

FCKeditor was retired and is no longer supported. All active development was moved to its successor, CKEditor 3.x, that is a fully mature and far superior product. We recommend you upgrade as soon as possible since this issue is no longer a problem in current code base.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy