Opened 12 years ago

Closed 12 years ago

#4955 closed defect (fixed)

Initial size is incorrect with AlwaysShowToolbar

Reported by: guest Owned by: liucougar
Priority: high Milestone: 1.1
Component: Editor Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Attachments (2)

EditTest.2.html (4.8 KB) - added by guest 12 years ago.
you need to configure the dojo path…
EditTest.html (1.4 KB) - added by Adam Peller 12 years ago.
place at dojo root

Download all attachments as: .zip

Change History (13)

comment:1 Changed 12 years ago by liucougar

could you submit a minimal test case to reproduce it?

comment:2 in reply to:  1 Changed 12 years ago by guest

Replying to liucougar:

could you submit a minimal test case to reproduce it?

I now find that it's nothing to do with the xhrPost thread. Instead it seems to be about the structure of the text passed to editor.setValue() or could it be related to the containers it in and the initial size??

Here is the key parts of my code extracted (i've not tested this in particular, just extracted it).

create an editor: (maybe you only needs the textarea and not the surrounding containers, but I include them here just in case): <div dojoType="dijit.layout.LayoutContainer?" id="main"> <div dojoType="dijit.layout.SplitContainer?"

id="workPane" orientation="horizontal" sizerWidth="5" activeSizing="0" sizeMin="50" sizeShare="85" layoutAlign="client"

<div id="editPane" dojoType="dijit.layout.ContentPane?" sizeMin="20" sizeShare="40" >

<textarea id="editCtl" dojoType="dijit.Editor" height=""

plugins="['italic', 'bold', '|', 'subscript', 'superscript' , '|', 'cut', 'copy', 'paste', '|', 'foreColor', 'hiliteColor' ]"

extraPlugins="['dijit._editor.plugins.AlwaysShowToolbar?'

, 'dijit._editor.plugins.EnterKeyHandling?' , 'dijit._editor.plugins.TextColor?' , {name:'dijit._editor.plugins.jeff'}

]"

<p>sample text</p></textarea>

</div> </div> </div>

Then change it this way: _uiEditUpd("<p>sample text</p>"); _uiEditUpd("<p>sample text1</p>"); _uiEditUpd("<p>sample text2</p><p>sample text 3</p>");

var _edWidget = dijit.byId('editCtl'); function _uiEditUpd( text ) {

console.debug( 'edit update had: ' + _edWidget.getValue() ); console.debug("editUpd: " + text); _edWidget.setValue( text ); console.debug( 'edit update now: ' + _edWidget.getValue() );

}

/* What I get is the editor only shows:

sample text 2

Then if you click on that, it will become:

sample text 2

sample text 3

Which it should have been in the first place. */

comment:3 Changed 12 years ago by guest

I find that if I call

editor.setValue( "<p>A</p><p>B</p>" );
editor.setValue( "<p>A</p><p>C</p>" );

the editor will display

A
C

but this doesn't work

editor.setValue( "<p>A</p>" );
editor.setValue( "<p>A</p><p>B</p>" );

I get the editor displaying

A

Until I click on the textarea/editor near the 'A' and then it displays correctly.

comment:4 Changed 12 years ago by Adam Peller

Milestone: 1.01.0.1

comment:5 in reply to:  4 Changed 12 years ago by guest

Replying to peller:

I've narrowed it down to the use of the plug-in: dijit._editor.plugins.AlwaysShowToolbar?

When it's used, and you do the setValue's above you get the problem, and when it's not used, the editor displays properly.

Further, I find that the plugin doesn't see to work either!

comment:6 Changed 12 years ago by Adam Peller

Milestone: 1.0.11.0.2

Changed 12 years ago by guest

Attachment: EditTest.2.html added

you need to configure the dojo path...

comment:7 Changed 12 years ago by Adam Peller

Milestone: 1.0.21.1

comment:8 Changed 12 years ago by Adam Peller

ok, so I'm trying to whittle away pieces of the test file that don't seem relevant. I'm down to the height="" attribute on your Editor. If that goes away, so does the problem. Is that the bug?

comment:9 Changed 12 years ago by Adam Peller

nm, that's how AlwaysShowToolbar? is supposed to work.

Changed 12 years ago by Adam Peller

Attachment: EditTest.html added

place at dojo root

comment:10 Changed 12 years ago by Adam Peller

Description: modified (diff)
Summary: Editor: multiple calls to setValue fails in xhrPost response threadInitial size is incorrect with AlwaysShowToolbar

In this example, the second line of text is not initially shown

comment:11 Changed 12 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [11771]) fixes #4955 also made _Plugin a bit more reusable wrt css customization

Note: See TracTickets for help on using tickets.