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

Inconsistent New Paragraph button

9 Answers 116 Views
Editor
This is a migrated thread and some comments may be shown as answers.
thejazzybrain
Top achievements
Rank 1
thejazzybrain asked on 14 Jul 2008, 03:11 PM

I am experiencing some inconsistent behavior with the New Paragraph feature on the Editor.

I did all my tests on your example at: http://www.telerik.com/DEMOS/ASPNET/Prometheus/Editor/Examples/Default/DefaultCS.aspx

On IE:
The ENTER key actually generates a  br  tag.
The button labeled New Paragraph creates a new p tag and places a space in it but places the cursor after the paragraph so if you start typing straight away the words you type are placed outside it and after it, as such:

<p>This is a paragraph</p> 
<p>&nbsp;</p>My new paragraph by clicking on the New Paragraph button 

This happens only if the cursor was placed at the last paragraph in the editor content before the button was clicked.

If another paragraph already exists after the one that the cursor is currently placed and you click on the New Paragraph button a new p tag is correctly added before the next paragraph but the cursor is placed at the beginning of the next one. If you start typing the content is placed on that paragraph leaving the new one in between untouched. There is no way to write in the new one unless you switch to the html view and add some content to the new paragraph in order to make it visible in the edit mode.

On FF:
The ENTER key actually generates a p tag.
The button labeled New Paragraph does absolutely nothing. 

9 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 17 Jul 2008, 08:28 AM
Hi Jason,

Currently, the InsertParagraph tool's implementation is based on the browser and indeed, there are some issues that we plan to fix after the upcoming Q2 release. Do you thing that it will be better to place the cursor within the paragraph? What will happen if there is no content in the editor and you hit the InsertParagraph tool? If the cursor is set within the paragraph, there will be no way to exit it.

Regarding the FF issue, I tested the behavior and everything worked fine - please find attached a sample video that demonstrates my test.

Kind regards,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
thejazzybrain
Top achievements
Rank 1
answered on 17 Jul 2008, 09:08 AM

Hello George,

To be honest I was confused with how this feature should be used. I was expecting this button to create a new paragraph for me to start typing in.
I see now that the behavior is more common when selecting some text and clicking on the button. This will wrap the selected text into a P tag.
I am not sure if it is me or the label of the button. The label “New Paragraph”, to me at least, indicates that a new paragraph will be created and not that the selected text will be enclosed within one. I understand that this is a user experience issue that differs according to language and culture.

I saw the video you sent me, try doing the same thing in IE. You will experience a totally different behavior.

The behavior I described is when no text is selected.

When no text is selected FF will wrap the text within a P tag but IE will create a new P tag just after the position of the cursor but the cursor will be placed after the P tag resulting in no way to start typing within the new P.

I am not sure what the optimum behavior would be. I consider this issue as e very important one. For me it is extremely important to be able to fully control whether the text will be wrapped within P tags or not. I create software that is used by people who only know how to use Word and Excel. They have no idea what a P tag is which means that it is out of the question to explain or force them to understand how to manually modify the HTML in case something goes wrong.

It all comes down the problem that I have to explain to my customers that this has a different behavior depending on their browser, and this is really bad for me.

0
Rumen
Telerik team
answered on 23 Jul 2008, 12:15 PM
Hi,

Thank you for your feedback!

Indeed, the InsertParagraph ("New Paragraph" tooltip) tool behaves differently in the different browsers, because the editor uses the InsertParagraph command of the browser under which operates:

editor.get_document().execCommand("InsertParagraph", false, false);

For example in Firefox the insertParagraph command inserts a paragraph around the selection or the current line, but in Internet Explorer it inserts a paragraph at the insertion point and deletes the selection.

What you can do is to override the InsertParagraph command of RadEditor and make your own implementation of the command:

<telerik:radeditor runat="server" ID="RadEditor1" >
  <Tools>
      <telerik:EditorToolGroup >
          <telerik:EditorTool Name="InsertParagraph" Text="Insert Paragraph" />
      </telerik:EditorToolGroup>
  </Tools>             
</telerik:radeditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["InsertParagraph"] = function(commandName, editor, args)
{
  alert("The InsertParagraph Command was overrided");
  // Execute your code here, provide it with any arguments that you need, etc.
};
</script>
Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
thejazzybrain
Top achievements
Rank 1
answered on 23 Jul 2008, 12:25 PM

Thank you for your answer.

Is this problem considered in the roadmap and if yes, is there an estimation in which release it will be fixed?

Thank you.
0
Rumen
Telerik team
answered on 24 Jul 2008, 12:38 PM
Hi Jason,

The requested feature to insert a new paragraph in Firefox via the Insert Paragraph button instead of the default browser behavior for wrapping the content  in <p></p> tags is very hard to be implemented, because of the multiple side effects and browser limitations.

Our most important task for Q3 2008 will be to fix all outstanding issues for RadEditor. I logged the requested feature in our todo list and we
will try to implement it. Please, note however that this will require a serious coding and time and we do not guarantee that we will be able to implement it.

I updated your Telerik points for your feature request.


Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
thejazzybrain
Top achievements
Rank 1
answered on 24 Jul 2008, 01:56 PM
I understand,

thank you.
0
Tervel
Telerik team
answered on 19 May 2009, 04:20 PM
Hello,

A small update:
=================================================================

The situation with FireFox + Paragraphs has been significantly improved, in fact a brand new implementation has been provided in the editor. You can give it a try by downloading the latest internal build of RadControls for ASP.NET AJAX from the following link: http://www.telerik.com/account/downloads/internal-builds.aspx. The currently available latest build is Telerik.Web.UI_2009_1_514_trial_hotfix.zip.

With regards to Paragraphs in IE - improvements have been made as well. One thing you *might* need to do (if you test with very simple content - one line only) is to disable one of the editor content filters from the code-behind, e.g:
  RadEditor1.DisableFilter(EditorFilters.FixEnclosingP);  

Last, but not least, as far as Paragraphs and Headings are concerned, I would like to point your attention to the following online demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/formatblock/defaultcs.aspx
(In the Internal Build there have been improvements to this functionality as well).

All of these improvements will be made official and public in the coming Q1 2009 SP2 to be released next week.

=================================================================

Best regards,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
amit aggarwal
Top achievements
Rank 1
answered on 11 May 2010, 11:07 AM
Hi,

I am facing the same issue which is there is this thread originally. Is there any fix available to cater this issue. New paragraph button should convert the selection into a paragraph.

Please help me out.

Thanks,
Amit
0
Rumen
Telerik team
answered on 13 May 2010, 11:51 AM
Hi Amit,

You can try the solution provided in this forum thread and further enhance it: New paragraph functionality.

Currently, only the Firefox engine wraps the selection in a paragraph when clicking firing the Insert Paragraph command. It is much easier to wrap the selection in <p></p> tags by using the Format Block tool instead of overriding the InsertParagraph command of the browser.

Sincerely yours,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
thejazzybrain
Top achievements
Rank 1
Answers by
George
Telerik team
thejazzybrain
Top achievements
Rank 1
Rumen
Telerik team
Tervel
Telerik team
amit aggarwal
Top achievements
Rank 1
Share this question
or