Opened 9 years ago

Closed 9 years ago

#16205 closed defect (wontfix)

_WidgetBase.js - isLeftToRight needs to use this.dir.toLowerCase() (Safari)

Reported by: barbossusus Owned by:
Priority: undecided Milestone: tbd
Component: Dijit Version: 1.7.3
Keywords: Cc:
Blocked By: Blocking:


Setting the dir constructor argument to "LTR" or "RTL" in ComboBox/FilteringSelect? does not take effect because isLeftToRight function in _WidgetBase.js should look something like this:

isLeftToRight: function(){
	// summary:
	//		Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
	// tags:
	//		protected
	return this.dir ? (this.dir.toLowerCase() == "ltr") : domGeometry.isBodyLtr(); //Boolean


This behavior could be observed in Safari if widgets are instantiated declaratively using capital letters.

Change History (1)

comment:1 Changed 9 years ago by bill

Component: GeneralDijit
Resolution: wontfix
Status: newclosed

It's true that setting dir to "LTR" or "RTL" doesn't work, but that's because "LTR" and "RTL" are invalid values for dir. It's documented as being either "ltr" or "rtl":

// dir: [const] String
//		Bi-directional support, as defined by the [HTML DIR](
//		attribute. Either left-to-right "ltr" or right-to-left "rtl".  If undefined, widgets renders in page's
//		default direction.
dir: "",

There are many cases throughout dijit where it assumes that dir is lowercase, such as this code from _BidiSupport.js:

var dir = this.textDir == "auto" ? this._checkContextual(text) : this.textDir;
return (dir == "ltr" ? bidi_const.LRE : bidi_const.RLE ) + text + bidi_const.PDF;

And of course, there are many other cases throughout dijit and other software where settings are case sensitive. So, I don't think it's worth supporting case sensitivity for this one property.

Note: See TracTickets for help on using tickets.