Skip to content

Commit

Permalink
Fixed clicking on suggestion in autocomplete dropdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Gorbatchev committed Dec 29, 2011
1 parent a99e3f7 commit 96e51a0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
11 changes: 8 additions & 3 deletions README.md
Expand Up @@ -50,16 +50,21 @@ The steps to using TextExt are as follows:

## History

#### 1.1.0
### 1.1.0

#### New Features
* Added `autocomplete.render` option for custom rendering. See the
[manual](http://textextjs.com/manual/plugins/autocomplete.html#autocomplete-render) and
[example](http://textextjs.com/manual/examples/autocomplete-with-custom-render.html).
* Added [Arrow plugin](http://textextjs.com/manual/plugins/arrow.html).
* Switched to MIT license.

#### Bug Fixes
* TextExt core now works with `<input/>` tags.
* Filter plugin now works without Tags.
* Switched to MIT license.
* Fixed clicking on suggestion in autocomplete dropdown.

#### 1.0.0
### 1.0.0
* Initial release.

## License
Expand Down
2 changes: 1 addition & 1 deletion src/js/textext.plugin.arrow.js
Expand Up @@ -68,7 +68,7 @@

self.baseInit(core, DEFAULT_OPTS);

arrow = self.core().wrapElement().append(self.opts(OPT_HTML_ARROW));
self.core().wrapElement().append(self._arrow = arrow = $(self.opts(OPT_HTML_ARROW)));
arrow.bind('click', function(e) { self.onArrowClick(e); });
};

Expand Down
4 changes: 2 additions & 2 deletions src/js/textext.plugin.autocomplete.js
Expand Up @@ -243,7 +243,6 @@
if(self.opts(OPT_ENABLED) === true)
{
self.on({
click : self.onClick,
blur : self.onBlur,
anyKeyUp : self.onAnyKeyUp,
deleteKeyUp : self.onAnyKeyUp,
Expand All @@ -267,7 +266,8 @@
container.insertAfter(input);

container
.mouseover(function(e) { self.onMouseOver(e) })
.bind('mouseover', function(e) { self.onMouseOver(e); })
.bind('click', function(e) { self.onClick(e); })
.addClass('text-position-' + self.opts(OPT_POSITION))
;

Expand Down
7 changes: 7 additions & 0 deletions tests/common.js
Expand Up @@ -299,7 +299,14 @@ function testAutocompleteFunctionality(finalAssert)
.assertElementNotPresent(suggestionsXPath(true, 1))
.assertVisible(suggestionsXPath(true, 0))

// test the mouse click
.click(suggestionsXPath(true, 0))
.waitForNotVisible(dropdown)
.assertValue(textarea, 'Basic')

.and(clearInput)
.typeKeys(textarea, 'oca')
.waitForVisible(dropdown)
.assertVisible(suggestionsXPath(true, 0))
.and(enterKey)
.assertNotVisible(dropdown)
Expand Down

0 comments on commit 96e51a0

Please sign in to comment.