Opened 11 years ago

Closed 11 years ago

#7611 closed defect (fixed)

BorderContainer: does not layout form widgets

Reported by: William Riley Owned by: bill
Priority: high Milestone: 1.2
Component: Dijit Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description

When adding an input widget, such as dijit.form.SimpleTextarea? or dijit.form.TextBox? to a dijit.layout.BorderContainer?, the BorderContainer? does not position the widget correctly.

Attachments (1)

borderContainer.html (1.2 KB) - added by William Riley 11 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed
Summary: BorderContainer does not layout form widgetsBorderContainer: does not layout form widgets

TextArea isn't supposed to work but SimpleTextArea does work, AFAIK, as of 1.2, as of [12384] (later that change was erased because SimpleTextArea inherits from TextBox, but of course the BorderContainer thing still works).

comment:2 Changed 11 years ago by William Riley

Resolution: fixed
Status: closedreopened

I figured out the problem

The form widgets are removing the dijitBorderContainerPane class during focus events, so position:absolute; is missing after it gets focus, but before that it gets laid out correctly.

I've attached a test.

Changed 11 years ago by William Riley

Attachment: borderContainer.html added

comment:3 Changed 11 years ago by bill

Ah, I see. Yah, FormWidget?.js does:

// Get original (non state related, non baseClass related) class specified in template
if(!("staticClass" in this)){
	this.staticClass = (this.stateNode||this.domNode).className;
}

and I guess addClass("dijitBorderContainerPane") happens after that.

I'll work on this.

comment:4 Changed 11 years ago by William Riley

I found another (related) problem, if a dijit.form.TextBox? is in a BorderContainer? without a textarea, it doesn't get it's width set.

Changing line 311 to this fixed the problem:

// Nodes in IE don't respond to t/l/b/r, and TEXTAREA/INPUT doesn't respond in any browser
var janky = dojo.isIE || dojo.some(this.getChildren(), function(child){
	return child.domNode.tagName == "TEXTAREA" || child.domNode.tagName == "INPUT";
});

comment:5 Changed 11 years ago by bill

Owner: set to bill
Status: reopenednew

comment:6 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

(In [15163]) Fixes #7611: BorderContainer?: does not layout form widgets.

Refactor _setStateClass() to be resilient when classes are added to domNode after the widget has been initialized. This is safer but slower than the old version, which saved the node's original class.

For fear of performance issues it's only writing into domNode.className once; code would have been shorter but possibly slower if it made many calls to addClass() and removeClass().

!strict

Note: See TracTickets for help on using tickets.