Opened 9 years ago

Closed 9 years ago

#11649 closed defect (fixed)

Selecting linefeed at start of text in Editor causes styling to not be applied - IE issue

Reported by: Katie Vance Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.6
Component: Editor Version: 1.5
Keywords: Cc: Katie Vance
Blocked By: Blocking:

Description

From a coworker:

If a linefeed is selected at the start of text in the editor in IE, styling can be applied correctly. However if you try to remove that styling while the text is still highlighted, the styling is not removed. The following steps can be used to reproduce this:

  1. Input several lines of text into the Editor for example like below.

a b c


  1. Select characters beginning with a linefeed. In this case, select from the linefeed character just after the character

'a' to the character 'b'.

  1. Add a style to the text e.g. Bold, to change the style of selected characters.

The bold styling will be applied.

  1. Select the same style button again (in this case bold) to restore the text to it's original format.

Problem: The text remains in bold - the styling is not restored.

This only occurs in IE and only occurs when the linefeed is selected at the start of the highlighted text.

Attachments (2)

richText.patch (2.7 KB) - added by Katie Vance 9 years ago.
patch to remove empty nodes from the node selection before invoking native browser commands
RichText_better.patch (4.7 KB) - added by Jared Jurkiewicz 9 years ago.
Updated patch to over-ride the commands using the RickText? over-ride pattern

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by Katie Vance

Attachment: richText.patch added

patch to remove empty nodes from the node selection before invoking native browser commands

comment:1 Changed 9 years ago by Katie Vance

Component: GeneralEditor

comment:2 Changed 9 years ago by Jared Jurkiewicz

Do you have a CLA on file?

comment:3 Changed 9 years ago by Katie Vance

Yeah, I'm working with Doug Hays at IBM.

comment:4 Changed 9 years ago by Jared Jurkiewicz

Milestone: tbd1.6

Ah, I expect you're my replacement, then.

Changed 9 years ago by Jared Jurkiewicz

Attachment: RichText_better.patch added

Updated patch to over-ride the commands using the RickText? over-ride pattern

comment:5 Changed 9 years ago by Jared Jurkiewicz

I updated your patch, it had a few issues.

1.) Your functions didn't have comments (summary, params, tags (protected, private, etc).

2.) You had places where you went against dojo style guidelines:

if(foo) { -> if(foo){ No spaces after )

3.) You didn't use the over-ride pattern for commands. The execCommand function itself should not over-ride specific commands, there is a pattern for doing it (_<command>Impl). That way it can easily customize any exec command by mixing in a function of that name, or providing a subclass that included it. (It also allows plugins to attach over-rides). So I moved your if command check into a series of command over-ride functions and returned execCommand to being a generic call.

comment:6 Changed 9 years ago by Jared Jurkiewicz

Resolution: fixed
Status: newclosed

(In [22782]) Applying supplied patch (after a few tweaks), to fix bold.italic/underline issue. \!strict fixes #11649

Note: See TracTickets for help on using tickets.