MultiAutoComplete - fix #980 and test refactoring #982

Closed
wants to merge 2 commits into
from

2 participants

@flongo

No description provided.

@flongo flongo added a commit to flongo/ariatemplates that referenced this pull request Feb 20, 2014
@flongo flongo refactor MultiAutiCompletre unit tests
Using class `test.aria.widgets.form.autocomplete.multiautocomplete.BaseMultiAutoCompleteTestCase`, all MultiAutoComplete testcases have been refactored.

Close #982
8241e17
@divdavem divdavem commented on an outdated diff Feb 20, 2014
...te/multiautocomplete/BaseMultiAutoCompleteTestCase.js
+ }
+ });
+ },
+
+ type : function (evt, args) {
+ args = args || evt;
+ this.synEvent.type(this._getField(), args.text[0], {
+ fn : this.__wait,
+ scope : this,
+ args : args
+ });
+ },
+
+ __wait : function (evt, args) {
+ var cb;
+ args.text.splice(0, 1);
@divdavem
Aria Templates member
divdavem added a line comment Feb 20, 2014

You could also use: args.text.shift()
Or, as this expression returns the value of the item being removed, you could even use this expression in the type method instead of args.text[0].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@divdavem divdavem commented on an outdated diff Feb 20, 2014
...ocomplete/multiautocomplete/template/MultiAutoTpl.tpl
@@ -33,8 +33,8 @@
width:400,
block:false,
labelWidth:180,
- maxOptions: 8,
- freeText:true,
+ maxOptions: data.maxOptions || 8,
+ freeText:!(data.freeText === false),
@divdavem
Aria Templates member
divdavem added a line comment Feb 20, 2014

You could write data.freeText !== false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@divdavem
Aria Templates member

I have reviewed 29fb5d8 and 8241e17 and both commits are fine for me.

@flongo

Thank you. I will apply the suggested changes and integrate

@flongo flongo added this to the 1.4.17 milestone Feb 20, 2014
@divdavem divdavem was assigned by flongo Feb 20, 2014
flongo added some commits Feb 20, 2014
@flongo flongo fix #980 Correct MultiAutoComplete initialization when bound data is …
…not empty

When freeText option was set to false, items already present in the data model to which the value of the widget is bound were not taken into account.
This commit reverts a fix done for another bug within commit 41d50bf: when freeText is equal to false, type some text for which there is no suggestion. Then blur. Then click inside the field and type something for which suggestions are returned. Pressing ENTER would cause all items to be duplicated.
8ab0c40
@flongo flongo refactor MultiAutoComplete unit tests
Using class `test.aria.widgets.form.autocomplete.multiautocomplete.BaseMultiAutoCompleteTestCase`, all MultiAutoComplete testcases have been refactored.

Close #982
3ffc3f1
@flongo flongo added a commit that closed this pull request Feb 20, 2014
@flongo flongo refactor MultiAutoComplete unit tests
Using class `test.aria.widgets.form.autocomplete.multiautocomplete.BaseMultiAutoCompleteTestCase`, all MultiAutoComplete testcases have been refactored.

Close #982
3c38899
@flongo flongo closed this in 3c38899 Feb 20, 2014
@carlo-mr carlo-mr added a commit to carlo-mr/ariatemplates that referenced this pull request Mar 3, 2014
@flongo flongo refactor MultiAutoComplete unit tests
Using class `test.aria.widgets.form.autocomplete.multiautocomplete.BaseMultiAutoCompleteTestCase`, all MultiAutoComplete testcases have been refactored.

Close #982
55118b5
@flongo flongo deleted the flongo:multiAutoComplete-enhanvements branch Jun 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment