GithubHelp home page GithubHelp logo

dojo / dijit Goto Github PK

View Code? Open in Web Editor NEW
174.0 47.0 187.0 29.52 MB

Dojo 1 - UI library

Home Page: https://dojotoolkit.org/

License: Other

JavaScript 30.85% PHP 0.44% HTML 59.02% CSS 7.10% Roff 0.01% Less 2.59%

dijit's Introduction

dijit

dijit is the package that contains the widget library for Dojo Toolkit. It requires the core of the Dojo Toolkit and provides a framework for building additional widgets as well as a full set of rich user interface widgets including form, layout and data-aware items.

While still being maintained, new development is primarily focused on modern Dojo.

Checkout the Dojo framework website or if you want a more detailed technical status and overview, checkout the Dojo roadmap.

Installing

Installation instructions are available at dojotoolkit.org/download.

Getting Started

If you are starting out with Dojo and Dijit, the following resources are available to you:

License and Copyright

The Dojo Toolkit (including this package) is dual licensed under BSD 3-Clause and AFL. For more information on the license please see the License Information. The Dojo Toolkit is Copyright (c) 2005-2018, The JS Foundation. All rights reserved.

dijit's People

Contributors

bryanforbes avatar cjolif avatar csnover avatar dbolter avatar dylans avatar edhager avatar jrburke avatar kfranqueiro avatar kitsonk avatar kriszyp avatar ktiedt avatar liucougar avatar msssk avatar neonstalwart avatar nicknisi avatar peller avatar phiggins42 avatar pottedmeat avatar rcgill avatar schallm avatar sfoster avatar shaneosullivan avatar sitepentorreyrice avatar slightlyoff avatar tkent avatar toonetown avatar ttrenka avatar uhop avatar vansimke avatar wkeese avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dijit's Issues

SimpleTextarea does not show placeHolder

I have SimpleTextarea with placeHolder:

<textarea data-dojo-type="dijit/form/SimpleTextarea" data-dojo-props="placeHolder:'Text area placeholder'></textarea>

but the placeHolder is not shown, because although SimpleTextarea descents from TextBox, it changes templateString and the placeHolder has nowhere to attach in

dijit/form/TextBox.js

Lines 68 to 73 in 8ab4cdc

this._phspan = domConstruct.create('span', {
// dijitInputField class gives placeHolder same padding as the input field
// parent node already has dijitInputField class but it doesn't affect this <span>
// since it's position: absolute.
className: 'dijitPlaceHolder dijitInputField'
}, this.textbox, 'after');
(because this.textbox has no parentElement).

dijit/Dialog shows vertical scrollbar even though not necessary

When a dijit/Dialog has no size constraints and the dialog becomes to wide for the viewport, it will limit the width to 90 % of the viewport. However, it will fix the height at the same time. This will prevent the dialog from growing in height due to word wraps etc. So vertical scrollbars may be shown even though not necessary. Even worse: while decreasing the viewport width, the scrollbars will be shown/hidden all the time.

I have created a fiddle demonstrating the issue.

The following images show what happens when you decrease the viewport size:
screenshot_2018-08-06 dojo layout in dialog - jsfiddle
screenshot_2018-08-06 dojo layout in dialog - jsfiddle 1
screenshot_2018-08-06 dojo layout in dialog - jsfiddle 2
screenshot_2018-08-06 dojo layout in dialog - jsfiddle 3

Drag and Drop from tree to other container not working in Firefox any more

Hi,

since a few Firefox versions it is not possible to drag a node out of a tree onto another dojo/dnd/Source element to drop it there. The drop allowed indicator does not appear, releasing the mouse button over the element acts as if the mouse is over any other non-dnd element.
Dnd within the tree works, so it seems like it is not a general problem.
With Chrome and Edge the mechanism works as intended.

Observations:

  • I think the Firefox version that first had this problem was the version that introduced their implementation of the pointer api
  • it seems like none of the mouseOver / mouseEnter events are triggered for the target container. I tried to identify which of the e.stopPropagation(); e.preventDefault(); in dojo/dnd and dijit/tree might be responsible, but had no luck with that approach

the issue was reported here: https://discourse.dojo.io/t/drag-and-drop-not-working-with-firefox-dojo-1-13/201 as well.

I have hacked together a single page example of the issue, you can reach it here: http://misc.digicult-verbund.de/tests/ff_tree.html

Issue with destroy method name on dojo/dijit 1.17.3 version

Hi Team, We are facing one issue with latest dojo and dijit upgrade to 1.17.3, we have our calendar view using widgets to display labels under each date, so when we are routing back (using router.go) to other view dojo is trying to destroy the widgets in calendar page and the below error was getting occurred with page getting struck without navigating to other view problem is while executing the advice.apply the destroy method name is passed as undefined where as other widgets it passed "remove" as name, with the older version of dojo/dijit like 1.9.X there wasn't any issue and navigation was working fine, if you could please check and let us know how this can be resolved it will be of great help and much appreciated. Thanks a lot in advance.

Error:
TypeError: handle[destroyMethodName] is not a function
at Object. (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:20675:31)
at Object.dispatcher [as destroy] (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:8640:29)
at Object._destroyRenderer (https://xxxxxxxxxxx.com/current/js/dojox/calendar/ViewBase.js:2:10728)
at Object.destroy (https://xxxxxxxxxxx.com/current/js/dojox/calendar/ViewBase.js:2:1306)
at Object.inherited (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:11345:30)
at Object.destroy (https://xxxxxxxxxxx.com/current/js/dojox/calendar/MatrixView.js:4:2908)
at Object.advice (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:8666:23)
at Object.dispatcher [as destroy] (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:8646:39)
at Object.destroyRecursive (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:19994:9)
at destroy (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:20017:8)TypeError: handle[destroyMethodName] is not a function
at Object. (https://xxxxxxxxxxx.com/current/js/xx/xxx/xxxxxx.js:1883:26)
at signalListener (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:7263:21)
at Deferred.then.promise.then (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:7484:5)
at Object. (https://xxxxxxxxxxx.com/current/js/xx/xxx/xxxxxx.js:1874:53)
at signalListener (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:7263:21)
at Deferred.then.promise.then (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:7484:5)
at Object._go (https://xxxxxxxxxxx.com/current/js/xx/xxx/xxxxxx.js:1869:55)
at Object. (https://xxxxxxxxxxx.com/current/js/xx/xxx/xxxxxx.js:1557:10)
at Object. (https://xxxxxxxxxxx.com/current/js/xx/xxx/xxxxxx.js:3267:10)
at Evented.dispatcher [as on/dojo/hashchange] (https://xxxxxxxxxxx.com/current/js/dojo/dojo.js:8653:39)

Code snapshot:
image

Errors in custom build - error(354) Root bundle indicates bundles that don't exists

I am upgrading the Dojo 1.13.0 to 1.16.2 in the project. While doing custom build am getting around 60 errors which are similar to the bellow in build report.
Root: digit/nls/dijit-all_ar; missing bundles:
'dijit/_editor/nls/FontChoice', 'dijit/_editor/nls/commands', 'dijit/form/nls/ComboBox', 'dijit/form/nls/validate', 'dijit/nls/common', 'dijit/nls/loading', 'dojo/cldr/nls/currency', 'dojo/cldr/nls/gregorian', 'dojo/cldr/nls/number', 'dojo/nls/colors'.

kindly let me know what is the problem.

dijit popup menus fail on current Chrome Beta (107)

Menus with popup children fail to show correctly, and warnings are seen in the console output on some installs of Chrome Beta channel (currently 107).

image

Download Chrome Beta channel (currently 107) for Windows (maybe other OSs?) and load the following tutorial:

https://dojotoolkit.org/documentation/tutorials/1.10/menus/demo/nestedProgMenu.html

Some machines work fine, however some break as described above. I assume it is Chrome testing on a certain percent of machines? I believe you will only see the issue if the following returns true in the Chrome Beta console window:

 Element.prototype.hasOwnProperty("popUp");

I believe it is due to this feature currently being tested: https://chromestatus.com/feature/5463833265045504

Is this a bug Chrome will fix or does dijit need to use a different attribute?

NumberTextBox.isValid does not work with trim

I have

<input data-dojo-type="dijit/form/NumberTextBox" data-dojo-props="constraints:{min:0,max:20,places:0}, intermediateChanges:true, trim:true"/>

and check in the code

numberTextBox.on("change", () => {
    okButton.set("disabled", numberTextBox.isValid());
});

This does not work when user enters a number with spaces, e.g. " 12 ". The checkbox show no error, but numberTextBox.isValid() returns false. I.e. if isValid() checks text value, it should do filter first.

Update: Workaround is to call NumberTextBox._setBlurValue() on change:

numberTextBox.on("change", () => {
    numberTextBox._setBlurValue();
    okButton.set("disabled", numberTextBox.isValid());
});

dijit/_WidgetBase constructor throws "calling chained constructor" error DOJO Version 1.17.3

I have got a Base class that inherits from [_WidgetBase,_TemplatedMixin] and there is not any Error during compile time but throws a "calling chained constructor" error at run time

[define( ["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin","dijit/_WidgetsInTemplateMixin","dojo/dom", "dojo/text!./templates/Menu.html"], function(declare ,_WidgetBase , _TemplatedMixin,_WidgetsInTemplateMixin,dom,template) {
return declare("com/ibm/b2b/ebics/client/ui/widgets/common/menu/Menu",[_WidgetBase,_TemplatedMixin], {

    templateString: template,
    constructor: function(thisVarBase){
    
    this.thisVarBase=thisVarBase;
    this.thisVarBase.debugMessage("com.ibm.b2b.ebics.client.ui.widgets.common.menu.Menu cons Entry");
    this.restURLEndpoint=this.thisVarBase.restURLEndpoint;
    console.log("menu User2");
    this.widgetId=this.thisVarBase.widgetId;
    this.menuWidgetLoaderId=null;
    this.HVUZobject=null;
    this.thisVarBase.debugMessage("com.ibm.b2b.ebics.client.ui.widgets.common.menu.Menu cons Exit");
    console.log("menu User3");
},

// @Override
postCreate : function() {
    console.log(" menu User4");
    this.inherited(arguments);
}

});
});

I have added console.log and the code went fine till console.log("menu User3") and after that dojo internally calls some chained constructor and throws Error

Dojo 38
_attrToDom
forEach
_attrToDom
set
_applyAttributes
create
postscript
chainedConstructor
showMenu
onLoad
constructor
chainedConstructor
construct
thelist
map
_instantiate
p
signalListener
then
parse
hitch
onEvent
handleDomReady
processQ
detectReady
on
domReady
runFactory
execModule
execModule
execModule
execModule
contextRequire
guardCheckComplete

Dialog with draggable:false opened through popup.open() with an around area still shows a move cursor

I have a page with a custom tab where the onClose opens a confirmation dialog. The below is the confirmation dialog:

<div data-dojo-type="dijit/Dialog"
	data-dojo-props="title:'<s:property value="%{getText('label.desktop.removeDesktop')}"/>', draggable: false"
	id="desktopRemoveDialog" style="display: none;">

	<div class="c-panel-dialog">
		<p class="c-panel-dialog__header">
			<s:property value="%{getText('label.desktop.removeDesktop')}" />
		</p>
		<div>
			<span id="removeDesktopConfirmationText" class="c-global-message c-global-message--error"></span>
		</div>
		<div class="l-panel-bottom-actions-wrapper u-margin-t-xs">
			<input id="removeDesktopOkButton"
				value="<s:property value="%{getText('button.delete')}"/>"
				type="button" class="c-button"> <input
				id="removeDesktopCancelButton"
				value="<s:property value="%{getText('button.cancel')}"/>"
				type="button" class="c-button">
		</div>
	</div>
</div>

The code to open this dialog is as such:

function onRemoveDesktop(tab) {
	textSpan = dom.byId("tabSpan" + tab.desktopOid);
	theRemoveConfirmationText = dom.byId("removeDesktopConfirmationText");
	theRemoveConfirmationText.innerHTML = removeDesktopConfirmationMessage.replace("{0}", "'" + textSpan.innerHTML + "'");
	registry.byId("desktopRemoveDialog").tab = tab;
	tabArea = dom.byId(tab.controlButton.id);
	popup.open({ //regular dijit/popup
		popup : registry.byId("desktopRemoveDialog"),
		around : tabArea
	});
}

I have 2 more tabs for editing and adding a tab that are handled through pretty much the same technique. In this particular combination of actions, it seems like the dialog doesn't get the dijitDialogFixed class that disabled the cursor:move CSS rule on the dialog title. I have another regular dialog on this page that is opened normally, and adding draggable: false to this dialog's data-dojo-props does properly apply the CSS rule.

Dojo version: 1.9.3. I know it's an older version, so if this is fixed in a newer version, feel free to close this.

dijit/Viewport:global variable orientation not defined on ios

@sebastianfrey commented on Wed Mar 21 2018

Hi there,

Saddly I am not able to submit a ticket at https://bugs.dojotoolkit.org/newticket#ticket, beacuse the spam mechanismn blocks me. So I submit the issue here, since at the dijit repo no issue section is available and the issue is dijit related. Sry for that. The related dojo version is 1.10.4..

The issue is, that DropDown's of dijit/form/FilteringSelect Elements are not shown on iOS. I think, I could nail down the reason for failing on iOS to dijit/Viewport.getEffectiveBox().

Viewport.getEffectiveBox = function(/*Document*/ doc){	
	// summary:
	//		Get the size of the viewport, or on mobile devices, the part of the viewport not obscured by the
	//		virtual keyboard.

	var box = winUtils.getBox(doc);

	// Account for iOS virtual keyboard, if it's being shown.  Unfortunately no direct way to check or measure.
	var tag = focusedNode && focusedNode.tagName && focusedNode.tagName.toLowerCase();
	if(has("ios") && focusedNode && !focusedNode.readOnly && (tag == "textarea" || (tag == "input" &&
		/^(color|email|number|password|search|tel|text|url)$/.test(focusedNode.type)))){

		// Box represents the size of the viewport.  Some of the viewport is likely covered by the keyboard.
		// Estimate height of visible viewport assuming viewport goes to bottom of screen, but is covered by keyboard.
		box.h *= (orientation == 0 || orientation == 180 ? 0.66 : 0.40);

		// Above measurement will be inaccurate if viewport was scrolled up so far that it ends before the bottom
		// of the screen.   In this case, keyboard isn't covering as much of the viewport as we thought.
		// We know the visible size is at least the distance from the top of the viewport to the focused node.
		var rect = focusedNode.getBoundingClientRect();
		box.h = Math.max(box.h, rect.top + rect.height);
	}

	return box;
};

There is a peace of code just for iOS included, which takes account for the virtual keyboard on iOS. So if a user hits the FilteringSelect, the above iOS specific peace of code, will be executed. The problem with this peace of code is, that there the global variable orientation is referenced directly, but it seems that orientation is not supported on Safari in general. https://caniuse.com/#feat=screen-orientation.

Again sry for submiting the issue here and thanks for looking into it.

Regards
Sebastian


@dylans commented on Wed Mar 21 2018

I have gone ahead and enabled issues for dojo/dijit as well. I'm going to move this issue over there.

DOMException: Failed to execute 'querySelectorAll' on '[group=group1] [role=role1]' is not a valid selector.

Hello,

It seems that the selectorEngine "lite" isn't well implementated at "dijit/RadioButtonMenuItem", currently you have the following code with the uncompatibility:

`

	_getRelatedWidgets: function(){
		// Private function needed to help iterate over all radio menu items in a group.
		var ary = [];
		query("[group=" + this.group + "][role=" + this.role + "]").forEach(
			function(menuItemNode){
				var widget = registry.getEnclosingWidget(menuItemNode);
				if(widget){
					ary.push(widget);
				}
			}
		);
		return ary;
	}

`
I think you need to change the query to:

query("[group='" + this.group + "'][role='" + this.role + "']")

Destroyable.own supports Deferred but not documented

Hello !

dijit.Destroyable.own source code indicates than this method accepts Deferred objects. Nevertheless this is not documented. Is there any reason for that?

Deferred reference documentation could mention it too. Any strategies, « patterns » related to the prévention of callback calls and Deferred cancellation due to the destruction of the Destroyable - widget or else- targetted by callbacks would be welcome too.

Thank you.

dijit/form/_FormSelectWidget:getOptions breaks without CSP unsafe-eval

The getOptions function in 1.16.3 contains the following snippet:

			if(lang.isArrayLike(valueOrIdx)){
				return array.map(valueOrIdx, "return this.getOptions(item);", this); // __SelectOption[]
			}

By providing a string for the callback value, the array module then attempts to create a Function from the string. This fails when unsafe-eval is not allowed by the content-security-policy and could be rewritten to pass a function instead of a string e.g.

return array.map(valueOrIdx, (item) => this.getOptions(item), this); // __SelectOption[]

_SearchMixin/_AutoCompleteMixin fails to autocomplete value of "8"

I'm using a FilteringSelect with a set of predefined values [{id:'1',label:'1-the value'},...,{id:'8',label:'8-lorem ipsum'}
Autocomplete is turned on.
If the user types '1', the label autocompletes and when pressing TAB, the value is set.
BUT - when typing '8', the value is not autocompleted and the value needs to be selected manually.

after some debugging I tracked it down to _SearchMixin._processInput() - there the /*boolean*/_prev_key_backspace flag is being calculated.
when typing '8', the keycode is "8" - when comparing it with dojo/keys.BACKSPACE because of auto(un)boxing, "8" equals 8 - and therefore the autocomplete code in _AutoCompleteMixin._openResultList() gets skipped.

proposed solution: use === to compare the charOrCode with the key-constant.

dijit/focus registers a click in a scrollbar as a focus change

dijit/focus registers a click in a scrollbar as a focus change while the browser does not change focus.
As a result _onBlur is called when it should not, and more importantly, not called when it should be called.

Consider this scenario:

  • I have a dijit/TextArea with intermediateChanges=false (the default)
  • type some text in the textarea
  • click on a scrollbar (any scrollbar) => dijit/focus considers this a focus change, thus calls _onBlur on widgets in the current stack and sets the new stack. The caret cursor though stays in the textarea.
  • type some more text
  • click anywhere outside the textarea => this is a focus change. The caret cursor disappears from the textarea. dijit/focus also registers it as a focus change, but since the active stack was already changed it will not call _onBlur on the textarea. The last text you entered is thus not set to the value of the textarea.

Found on dojo version 1.16.2

dijit/form/Select multi-select

Everyone,

I'm trying to use dijit/form/Select. The reason I've chosen it is that I need the ability to style the elements. I'd also like to do multi-select. I see that "multiple" is documented as a property for this object. My code is:

<div value="1"   data-dojo-type="dijit/form/Select"  id="IDwbs" multiple="true" name="wbs" >
<span value="3"><span style="background-color: purple; color: white; padding: 4px;">0.1.2 + The Master</span></span>
<span value="1" ><span style="margin-left: 1em; font-weight: bold; color: white; background-color: teal;">1.2.3 + The Barn</span></span>
<span value="2"><span style="margin-left: 2em">2.3.4 + The Granary</span></span>
</div>

I've also tried:

<div value="1"   data-dojo-type="dijit/form/Select"  id="IDwbs" multiple  name="wbs" >
AND
<div value="1"   data-dojo-type="dijit/form/Select"  id="IDwbs" data-dojo-props="multiple: true" name="wbs" >

Does this element support multi-select? Is there a multi-select that supports using styles?

Thanks for the help!

George

BackgroundIframeJs violating CSP

I am attempting to implement a CSP, using self, some domains, some hashes as well as a nonce.

My CSP is flagging script-src-elem when attempting to run line 75 of BackgroundIframe.js. I believe that it is because the iframe src property is being set to javascript:"".

Removing the explicit setting of the src to javascript:'' solves the issue.

Dialog._dialogStack holds reference to removed node

Dialog._dialogStack items focus property is not cleared, so the 0th item may hold a reference to an item removed from DOM i.e. kind of a leak. I suggest one of the following solutions:

  • Stop using previous ds item and just set previous focus to the current ds item.
  • The focus in the previous ds item is removed on hide().
  • The focus is held by a weak reference.

CurrencyTextBox does not select value when tabbed to in Chrome

CurrencyTextBox does not keep selection like other text boxes do when tabbed to if currency property is specified in dojo 1.10.8 or current (1.13.0). It seems to be a race condition when reformatting without the currency symbol. Works as expected in current versions Edge and Firefox.

Example

  1. Click to set focus in one of the text boxes below.
  2. Use Tab and Shift+Tab to navigate using the keyboard.
  3. Notice that the CurrencyTextBox does not keep the contents selected when tabbed to if currency property is specified
    <div class="control-group">
        <label for="CurrencyTextBox">Currency Text Box:</label>
        <input data-dojo-type="dijit/form/CurrencyTextBox" id="CurrencyTextBox" />
    </div>
    <div class="control-group">
        <label for="EURCurrencyTextBox">EUR Currency Text Box:</label>
        <input data-dojo-type="dijit/form/CurrencyTextBox" id="EURCurrencyTextBox" data-dojo-props="currency: 'EUR'" />
    </div>
    <div class="control-group">
        <label for="USDCurrencyTextBox">USD Currency Text Box:</label>
        <input data-dojo-type="dijit/form/CurrencyTextBox" id="USDCurrencyTextBox" data-dojo-props="currency:'USD'" />
    </div>

Editor not displaying current font size and font name

In Firefox and IE 11, the FontChoice plug-in is not show the current font size and font name for text that is entered into the editor with the default font name and size.

  1. Go to http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/editor/test_FontChoice.html.
  2. Click in the first editor.

Notice the "Font" and "Size" dropdowns are empty until you click on text that has been modified (font size other than "small" or a font name other than the default).

dojox/form/CheckedMultiSelect can not be cleared programatically probably due to a bug in dijit/form/_FormSelectWidgetMixin

Description:
I have a CheckedMultiSelect widget configured to allow multiple values, if I call:

mywidget.set("value", ["value1", "value2"]);

Selects the two values as expected.
If I call:

mywidget.set("value", []);

Expected behaviour:
No value should be selected in the widgets and all the checkboxes should appear unchecked.

Actual behaviour:
The already selected checkboxes remain checked. Interestingly though, if you click in a different checkbox than the already selected one you will notice that the others are unchecked.

Doing mywidget.set("value", "") doesn't solve the problem either.

How to reproduce:
See this Fiddle: http://jsfiddle.net/41Lh0zoj/

More info:
I think that the problem is exactly here:

if(typeof val == "undefined" || typeof val[0] == "undefined"){

I don't think that checking 'typeof val[0] == "undefined"' is right, because like in this case, val might be an empty array and that seems perfectly fine to me. Doing this additional checks avoids calling _setDiaplsy and _updateSelection which is causing the reported problem.

TabContainer issue in IE11

TabContainer in IE is not rendering content in tabbed fashion, instead renders as vertical content. Please help me to resolve this issue.

Note:Even CodeGlass example listed in documentation renders that way
IE

Getting error TypeError: "ancestor.contains is not a function"

Hi, We are getting the following error after migrating from dojo 1.7 to 1.16.2

dojo/parser::parse() error TypeError: "ancestor.contains is not a function"
    isDescendant Dojo
    check dijit/focus.js:58
    Dojo 3
        hitch
        dispatcher
        destroy
    _createDojoDeferredTypes datastage/widget/_DeferredLoadMixIn.js:116
    startup datastage/widget/layout/TabContainer.js:66
    startup dijit/_WidgetsInTemplateMixin.js:101
    forEach Dojo
    startup dijit/_WidgetsInTemplateMixin.js:99
    startup dijit/_WidgetBase.js:573
    forEach Dojo
    startup dijit/_WidgetBase.js:571
    inherited__debug Dojo
    startup dijit/layout/_ContentPaneResizeMixin.js:54
    inherited__debug Dojo
    startup dijit/layout/ContentPane.js:203
    startup dijit/_WidgetBase.js:573
    forEach Dojo
    startup dijit/_WidgetBase.js:571
    inherited__debug Dojo
    startup dijit/layout/_LayoutWidget.js:60
    inherited__debug Dojo
    startup dijit/layout/LayoutContainer.js:58
    startup dijit/_WidgetsInTemplateMixin.js:101
    forEach Dojo
    startup dijit/_WidgetsInTemplateMixin.js:99
    Dojo 14
        onConstruct
        forEach
        onConstruct
        signalListener
        then
        _instantiate
        p
        signalListener
        then
        parse
        hitch
        onEvent
        processQ
        detectReady
dojo/parser.js:900:14
    Dojo 9

It looks like a widget is passed to isDescendant() while the only accepted values are DOM ID string or a DOM node.
See the discussion in the issue that we have opened regarding. isDescendant function.
dojo/dojo#375

Should dijit's _WidgetBase._attrToDom support textContent

innerText is not a cross-browser supported attribute. _WidgetBase._attrToDom accepts innerText as the type of a command to put text into node.

The implementation doesn't actually use the innerText property:

	case "innerText":
		mapNode.innerHTML = "";
		mapNode.appendChild(this.ownerDocument.createTextNode(value));
		break;

We are attempting to make sure we don't us innerText anywhere in our code base. It would be nice if textContent was accepted here as well:

	case "textContent":
	case "innerText":
		mapNode.innerHTML = "";
		mapNode.appendChild(this.ownerDocument.createTextNode(value));
		break;

Code above could potentially be simplified to set textContent as well?

dijit.Tree with betweenThreshold not compatible with dojo/store/Memory

betweenThreshold, which lets users manually reorder elements by dragging them between others in the tree, appears to be incompatible with the Memory storage system. Dragging an element between two others using that configuration causes it to disappear, as highlighted by this snippet of code in the ObjectStoreModel which, while it does adress the issue with the default tree config, still causes the problem to occur when manual reordering is enabled.

Steps to reproduce:

EDIT: See related issue on the old tracker.

Programmatic tab container overflow menu not scrolling

We have a set of dynamic tabs that get added/removed from a tab container programmatically. Horizontal scroll arrows work as expected. In the created popup menu, we find that only the tab titles in the visible height of the screen are shown, and attempting to scroll within the popup menu doesn't work. Tab container is several levels down within nested border containers.
What we suspect is that when the title width exceeds the px width set in ScrollingTabController.js / onAddChild (~line 111) the menu loses it's ability to scroll. Found that if we change the default 200 px width to say 400 px, our menu loads correctly.

StackContainer does not update selectedChildWidget properly when all tabs are removed

The recommended way to listen to selected tab change is

myTabContainer.watch("selectedChildWidget", function(name, oval, nval){
    console.log("selected child changed from ", oval, " to ", nval);
});

see https://dojotoolkit.org/reference-guide/1.10/dijit/layout/TabContainer.html#tabcontainer-events

It works for TabContainer.addChild and TabContainer.removeChild, too. However, then TabContainer.removeChild removes the last selected tab, then the watch event is not fired, but the selectedChildWidget is set to undefined, see https://github.com/dojo/dijit/blob/master/layout/StackContainer.js#L204 I would like selectedChildWidget to set properly even when the last tab is removed.

dateTextBox will flag a date as invalid while it's being typed

When you have a dateTextBox with min and/or max constraints on it, you can get an out of range indicator while you’re typing a valid date. For example if you have a dateTextBox with a valid range of 3/21/2018 to 3/31/2018 and you type 3/25/20 you will get an out of range message. I would expect this to see that adding 18 would make this a valid value, and not show the indicator until the control lost focus.

Add child fails while adding a TitlePane to layout

After upgrading the product to 1.17, on debug found that below code misses check for refNode. This code check was there in earlier versions

declare("dijit._Container", null, {
   	addChild: function(/*dijit/_WidgetBase*/ widget, /*int?*/ insertIndex){
   		var refNode = this.containerNode;
   		if(insertIndex > 0){
   			refNode = refNode.firstChild;
   			// There is missing null check for refNode, this fails while adding objects
                              while(insertIndex > 0){
   				if(refNode.nodeType == 1){ insertIndex--; }
   				refNode = refNode.nextSibling;
   			}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.