How to fix IE select issue when dynamically changing options

前端 未结 13 531
南旧
南旧 2020-12-04 16:38

I have a set of selects that all have the same options. Then I run those options through a filter so that any options that are selected in a different select don\'t show up

13条回答
  •  萌比男神i
    2020-12-04 16:44

    I have a workaround for the IE picklist issue

    Before Fix:http://plnkr.co/edit/NGwG1LUVk3ctGOsX15KI?p=preview

    After Fix:http://plnkr.co/edit/a7CGJavo2m2Tc73VR28i?p=preview

    $("select").click(function(){
      $(this).append('');
       $(this).find('option:last').remove();
    
    });
    

    I just added dummy option for the dom to rerender the select and removed it. let me know it works for you

提交回复
热议问题