Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#15976 closed defect (invalid)

Programmatically created Textarea is not mirrored

Reported by: ahmedasaleh Owned by:
Priority: undecided Milestone: tbd
Component: Dijit - Form Version: 1.8.0
Keywords: Cc:
Blocked By: Blocking:

Description

Using the test_Textarea.html file to test the BIDI support for the Textarea, it found that dijit.form.Textarea is not mirrored when dir is specified on widget level.

<textarea id="programmatic" dir="rtl"></textarea>

<script type="text/javascript">
// See if we can make a widget in script
	dojo.addOnLoad(function(){
	programmaticTextarea = new dijit.form.Textarea({
					id: "programmatic",
					name: "programmaticTextArea",
					cols: "60",
					value: "created programatically with custom border, padding, margin",
					style: "border:5px solidgray;padding:11px;margin:7px;"
					}, "programmatic");
				});
           </script>

Attachments (2)

textarea.JPG (14.3 KB) - added by ahmedasaleh 7 years ago.
Programmatically created dijit.Textarea is not mirrored when dir is specified on widget level
Textarea.js.patch (706 bytes) - added by Douglas Hays 7 years ago.
patch from Hossam Katory (IBM, CCLA)

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by ahmedasaleh

Attachment: textarea.JPG added

Programmatically created dijit.Textarea is not mirrored when dir is specified on widget level

comment:1 Changed 7 years ago by bill

Component: GeneralDijit - Form
Resolution: invalid
Status: newclosed

Your test is invalid because you didn't specify dir as a parameter to the Textarea constructor. The dir attribute in the markup is irrelevant for programmatic creation.

comment:2 Changed 7 years ago by ahmedasaleh

Specifying dir on widjit level should be propagated to the grammatically created widjit. I understand that the current code of the widjit doesn't support that but I think the following code could fix it:

	buildRendering: function(){
		this.inherited(arguments);

		/* Modifications start here*/
		var myDijit = dijit.byId(this);
		var node = dojo.byId(myDijit.id);
		if(node.dir == "rtl"){
			myDijit.set("dir","rtl");
		}
		/* Modifications end here*/

		// tweak textarea style to reduce browser differences
		domStyle.set(this.textbox, { overflowY: 'hidden', overflowX: 'auto', boxSizing: 'border-box', MsBoxSizing: 'border-box', WebkitBoxSizing: 'border-box', MozBoxSizing: 'border-box' });
	}

comment:3 Changed 7 years ago by bill

We intentionally don't support that. If you want to read parameters from the HTML markup, you should use the parser.

Changed 7 years ago by Douglas Hays

Attachment: Textarea.js.patch added

patch from Hossam Katory (IBM, CCLA)

Note: See TracTickets for help on using tickets.