Internet Explorer 8+ と select2 コンポーネントを使用すると奇妙な問題が発生します。値を選択すると、非同期ポストバックを実行してドロップダウンリストを更新します。その後、ページの背景やその他のコントロールをクリックするまで、ページをスクロールしたり、ボタンをクリックしたりすることはできません。
これがページの構造です
Javascript:
$(function()
{
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(function (sender, args) {
InitSelect();
});
InitSelect();
});
function InitSelect(){
$('select')
.select2()
.off('change')
.change(function () { __doPostBack(this.id, "dllChanged"); });
}
ASP.NET
<asp:UpdatePanel ID="udpBase" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:UpdatePanel ID="udpSomething" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<CustomControl:DropDownList ID="element1" runat="server" />
<CustomControl:DropDownList ID="element2" runat="server" />
<CustomControl:DropDownList ID="element3" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button id="btn" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
Firefox、Chrome、Operaでは正常に動作します...
change イベントの後、ページの本文にフォーカスを設定しようとしました。ボタンをクリックできるようになりましたが、スクロールの問題はまだ存在します...
私は使用しています:
JQuery: 1.10.2
Select2: 3.4.5
ASP.NET: 3.5
あなたが私を助けてくれることを願っています... :)