This is a migrated thread and some comments may be shown as answers.

[Solved] IE 8 Text Centre Issue

3 Answers 146 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeff Paetkau
Top achievements
Rank 1
Jeff Paetkau asked on 09 Jan 2010, 12:05 AM
Hi,

I am having an issue with how the text centre tool behaves in IE. To reproduce:

1)  Paste the following text into an editor

This text should not centre
This text should centre

2) Highlight "This text should centre"

3) Click the text centre tool

In Chrome it behaves as expected and centre's "This text should centre" but not "This text should not centre". However, in IE bot lines are centered.

Any suggestions?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 11 Jan 2010, 11:58 AM
Hi Jeff,

The RadEditor's content area is an editable IFRAME element and it uses the rich text editing engine of the browser where it operates. The browser's JustifyLeft, JustifyCenter and JustifyRight commands are implemented by different browser creators and they behave differently in IE and Chrome. In IE when you fire some of these commands the whole paragraph is getting aligned. In Chrome only the selected line is aligned because the browsers wraps it in a div tag.

Please, see the following KB article, which provides guidance how to align only the selected line in IE: Applying indentation or alignment per line.

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jeff Paetkau
Top achievements
Rank 1
answered on 11 Jan 2010, 05:18 PM
Hi,

Thanks. We already are aware of the NewLineBr property. However, there are two issues. One, both IE and other browsers are used. Two, a common scenario for our users is to enter content composed elsewhere. Users are trained to use the paste-as-plain-text button to remove formatting from Word and other editors. <br/>'s are not converted to <p>'s in this scenario. 

As you can see, even if NewLineBr is set to false we will have a mix of <br/>'s & <p>'s. Hence behavior will be wildly inconsistent from line to line and browser to browser.

Is there any other workarounds?

If there isn't any may I make several suggestions for future versions?

1) Make NewLineBr=false work in non IE browsers
2) Make NewLineBr=false work when pasting plain-text
3) Create a set of buttons that makes breaks consistent. Perhaps these could be options in the "format stripper". One button would convert all <br/>'s to <p>'s. The other would do the opposite.
4) In IE when the text-align buttons are pressed dynamically create a div surrounding the selected text before the built in browser function to align the text is called.
5) Have a format stripper similar to "strip all formatting" but is instead "strip all formatting except line breaks" which would strip all HTML content and convert all block level elements to <br/>'s or <p>'s.

Any or all of these would greatly help with this issue. I am sure I am not the only one experiencing it.

Any suggestions on how I can improve the experience for my users would be greatly appreciated.


0
Rumen
Telerik team
answered on 12 Jan 2010, 11:34 AM
Hi Jeff,

Thank you very much for your suggestions.

The implementation of the requested features will be very hard due to the multiple browsers' limitations, but we will try to enhance the alignment and implement a cross browser alignment per line. I logged this feature to our "add new features" list and we will do our best to implement it in some of the next major RadControls for ASP.NET releases.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Jeff Paetkau
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Jeff Paetkau
Top achievements
Rank 1
Share this question
or