【问题标题】:Triple-click selects the next element with Angular Bootstrap modal三击使用 Angular Bootstrap 模式选择下一个元素
【发布时间】:2016-03-03 20:27:53
【问题描述】:

我有一个使用 (UI) Bootstrap 的 Angular 应用程序,我在 wellcode 元素内的模态正文中显示一个 URL。模态页脚只有一个关闭按钮。现在,如果三次单击 URL 进行复制,页脚中的关闭按钮文本也会被选中,并且不能像往常一样将其粘贴到另一个选项卡。

Fiddle here

<div class="modal-body">
    <div class="well">
        <code>http://www.google.com/</code>
    </div>
</div>
<div class="modal-footer">
    <button type="button" ng-click="close()" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>

我搜索了很多,但无法提出解决方案(尝试了 CSS 的用户选择,将其包装在不同的元素中,这似乎不起作用)。

【问题讨论】:

    标签: angularjs twitter-bootstrap modal-dialog copy


    【解决方案1】:

    &lt;button&gt; 替换为&lt;input&gt; 以禁用文本选择:

    <input type="button" ng-click="close()" class="btn btn-primary" data-dismiss="modal" value="Close"></input>
    

    Updated Fiddle

    【讨论】:

    • 非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-12-16
    • 1970-01-01
    • 1970-01-01
    • 2019-10-01
    • 1970-01-01
    • 2016-12-01
    • 2021-10-03
    相关资源
    最近更新 更多