Improve hint behaviour in webkit
Change-Id: Ib0dd00e4c54764afc13423c5f514afb3f7cad4ce
diff --git a/dev/js/src/hint/menu.js b/dev/js/src/hint/menu.js
index a7bdf57..105273e 100644
--- a/dev/js/src/hint/menu.js
+++ b/dev/js/src/hint/menu.js
@@ -1,12 +1,19 @@
/**
* Hint menu
*/
-define(['menu',
+define([
+ 'menu',
'hint/item',
'hint/prefix',
- 'hint/lengthField'], function (menuClass, itemClass, prefixClass, lengthFieldClass) {
- return {
+ 'hint/lengthField'
+], function (
+ menuClass,
+ itemClass,
+ prefixClass,
+ lengthFieldClass) {
+ return {
+
/**
* Create new hint helper menu.
*/
@@ -25,14 +32,20 @@
// Make the top item always active
obj._firstActive = true;
- // This is only domspecific
obj.element().addEventListener('blur', function (e) {
this.menu.hideWithoutDestruction();
});
// Focus on input field on hide
obj.onHide = function () {
- this._hint.unshow();
+ var h = this._hint;
+ h._inputField.element().focus();
+ if (h.active() !== null) {
+ if (h._alert.active) {
+ h._unshowAlert();
+ };
+ h.active(null);
+ };
};
return obj;