fabiomcosta / mootools-meio-autocomplete

A complete mootools Autocomplete plugin
http://www.meiocodigo.com/projects/meio-autocomplete/
32 stars 14 forks source link

JS error in IE 8 #10

Closed jano-petras closed 12 years ago

jano-petras commented 12 years ago

After an autocompleter has been initialised, and the page is unloaded, JS error is thrown in IE 8.

This is the line in question:

$(global).addEvent('unload', function(){ if (this.node) this.node.set('autocomplete', 'on'); // if autocomplete is off when you reload the page the input value gets erased }.bind(this));

throwing 'object does not support this property or method' - it is as if the DOM element has lost its mootools bindings and behaves as a plain IE DOM element.

I have found that the script works fine if setting autocomplete to on is wrapped with $, so:

if (this.node) $(this.node).set('autocomplete', 'on');

fabiomcosta commented 12 years ago

Right, thank you very much and sorry for taking so long.