ui.bootstrap.dropdown在单击其他控件时保持焦点

时间:2016-12-26 10:05:45

标签: angularjs angular-ui-bootstrap

我正在尝试使用<com.yourpackage.MyDrawerLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/my_drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- .... --> </com.yourpackage.MyDrawerLayout> Angular UI指令来解决问题。在我查看下拉列表的插入符然后单击正文中的任何位置之后,如果我尝试单击文本字段,则文本字段立即失去焦点并且焦点返回到下拉按钮的插入符号。然而,我无法在一个plunker中产生这种行为。但是这种行为可以在ui.bootstrap.dropdown演示页面中生成。产生这种行为 -

  • 转到https://angular-ui.github.io/bootstrap/#/dropdown
  • 点击其中一个插入按钮以显示菜单
  • 点击正文上的任意位置即可关闭菜单
  • 向上滚动到datepicker弹出演示部分
  • 尝试将光标放在其中一个文本字段
  • 文本字段将立即失去焦点,页面将向下滚动到最初点击的下拉按钮插入符号。

我不确定如何阻止这种情况发生。任何帮助将受到高度赞赏。

更新

似乎此行为仅存在于版本Angular UI中。如果我使用2.3.1,则不会发生这种情况。这是一个产生相同行为的plunker - http://plnkr.co/edit/c4EGyxQD1vbksFWjnIGb

更新

这是版本2.3.0中的错误,已在AngularUI Github中引发。 链接到给出的问题以供参考 -

https://github.com/angular-ui/bootstrap/issues/6364

https://github.com/angular-ui/bootstrap/issues/6372

1 个答案:

答案 0 :(得分:0)

此错误已在2.3.2版本中修复