pbauerochse / searchable-option-list

a jquery plugin for a searchable optionlist
MIT License
79 stars 54 forks source link

IE8 does not support input event #12

Closed fc closed 8 years ago

fc commented 8 years ago

The input event is not supported in IE8 according to here (it is supported in IE9+): http://help.dottoro.com/ljhxklln.php

This modification will detect changes on the value property using the propertychange event:

            this.$input
                .focus(function () { self.open(); })
                .on('propertychange input', function (e) {
                    var valueChanged = false;
                    if (e.type=='propertychange') {
                        valueChanged = e.originalEvent.propertyName=='value';
                    } else {
                        valueChanged = true;
                    }
                    if (valueChanged) {
                        self._applySearchTermFilter();
                    }
                });
fc commented 8 years ago

I'm still new to working with git/github and sent the fix to you as a pull request (is that how this is supposed to work haha ??)...

It didn't look like it would break anything and the input events are still manually triggered via trigger('input') when needed.

pbauerochse commented 8 years ago

Hi @fc ,

I merged your pull request. Thanks for contributing.

Cheers

Patrick