#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)
Change History (5)
Changed 9 years ago by
Attachment: | textarea.JPG added |
---|
comment:1 Changed 9 years ago by
Component: | General → Dijit - Form |
---|---|
Resolution: | → invalid |
Status: | new → closed |
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 9 years ago by
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 9 years ago by
We intentionally don't support that. If you want to read parameters from the HTML markup, you should use the parser.
Programmatically created dijit.Textarea is not mirrored when dir is specified on widget level