jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.69k stars 2.4k forks source link

Filterable custom selectmenu doesn't working properly after filtered #8413

Closed wwy94621 closed 8 years ago

wwy94621 commented 8 years ago

I found the filterable custom selectmenu doesn't working properly after filtered. For example, I have a list as below:

after input "2" for filter, I get the new list as below:

If I click first Item now, instead of set it as checked, system will set second Item as checked.

I checked the source file of jquery.mobile-1.4.5.js and found there is a bug at line 11557: if ( $.inArray( i, indices ) > -1 ) { i is the index of filtered list, and indices include the index of no filtered, that's why system set the wrong item as checked/unchecked.

apsdehal commented 8 years ago

@wwy94621 Can you create a fiddle for this and share the link here?

wwy94621 commented 8 years ago

Hi, please check the jsfiddle. input "2" and try to select some item, you may see the issue.

Thanks

wwy94621 commented 8 years ago

@apsdehal Did you check the fiddle, do you see the bug?

apsdehal commented 8 years ago

I can confirm the issue. Closed it by mistake.

apsdehal commented 8 years ago

So I have discussed this with team and custom filterable selectmenu doesn't allow multiple. And since we plan to shift to UI selectmenu, I am going to close this issue. You can fix the select without multiple by removing the multiple attribute.