forked from 0x2620/oxjs
in input elements, disable showing the autocomplete menu on focus
This commit is contained in:
parent
b0065e1ec8
commit
571e3a3512
3 changed files with 22 additions and 14 deletions
|
|
@ -300,7 +300,7 @@ Ox.Input = function(options, self) {
|
|||
oldValue = Ox.isUndefined(oldValue) ? self.options.value : oldValue;
|
||||
oldCursor = Ox.isUndefined(oldCursor) ? cursor() : oldCursor;
|
||||
|
||||
Ox.Log('Form', 'autocomplete', oldValue, oldCursor)
|
||||
Ox.Log('AUTO', 'autocomplete', oldValue, oldCursor)
|
||||
|
||||
if (self.options.value || self.options.autocompleteReplaceCorrect) {
|
||||
if (Ox.isFunction(self.options.autocomplete)) {
|
||||
|
|
@ -404,6 +404,7 @@ Ox.Input = function(options, self) {
|
|||
});
|
||||
self.selectEventBound = true;
|
||||
}
|
||||
Ox.Log('AUTO', 'show menu')
|
||||
self.$autocompleteMenu.options({
|
||||
selected: selected
|
||||
}).showMenu();
|
||||
|
|
@ -692,7 +693,8 @@ Ox.Input = function(options, self) {
|
|||
// fixme: different in webkit and firefox (?), see keyboard handler, need generic function
|
||||
Ox.UI.$document.keydown(keydown);
|
||||
//Ox.UI.$document.keypress(keypress);
|
||||
self.options.autocompleteSelect && setTimeout(autocomplete, 0); // fixme: why is the timeout needed?
|
||||
// temporarily disabled autocomplete on focus
|
||||
//self.options.autocompleteSelect && setTimeout(autocomplete, 0); // fixme: why is the timeout needed?
|
||||
}
|
||||
that.triggerEvent('focus');
|
||||
}
|
||||
|
|
@ -725,6 +727,7 @@ Ox.Input = function(options, self) {
|
|||
}
|
||||
if (value != self.options.value) {
|
||||
self.options.value = value;
|
||||
Ox.Log('AUTO', 'call autocomplete from keydown')
|
||||
self.options.autocomplete && autocomplete(oldValue, oldCursor);
|
||||
self.options.autovalidate && autovalidate(oldValue, oldCursor);
|
||||
self.options.changeOnKeypress && that.triggerEvent({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue