gpt4 book ai didi

css - ng-bootstrap 打开焦点输入字段 css 不起作用

转载 作者:太空宇宙 更新时间:2023-11-04 06:50:25 25 4
gpt4 key购买 nike

我用过 ng Typeahead Open on focus输入,我的冲突是他们使用的是 bootstrap-4 但我已经为我的元素使用了 bootstrap 3 ,用于 Open on focus 的 bootstrap 3 无法正常工作,任何一个知道如何在 bootstrap 3 上实现它吗?

html

<input
id="typeahead-focus"
type="text"
class="form-control"
[(ngModel)]="model"
[ngbTypeahead]="search"
(focus)="focus$.next($event.target.value)"
(click)="click$.next($event.target.value)"
#instance="ngbTypeahead"
/>

stackblitz code here

最佳答案

只需在您的 style.css 中添加以下 css,您的元素就会显示良好,例如:

.dropdown-item {
display: block;
width: 100%;
padding: .25rem 1.5rem;
clear: both;
font-weight: 400;
color: #212529;
text-align: inherit;
white-space: nowrap;
background-color: transparent;
border: 0
}

.dropdown-item:focus,
.dropdown-item:hover {
color: #16181b;
text-decoration: none;
background-color: #f8f9fa
}

.dropdown-item.active,
.dropdown-item:active {
color: #fff;
text-decoration: none;
background-color: #007bff
}

.dropdown-item.disabled,
.dropdown-item:disabled {
color: #6c757d;
background-color: transparent
}

.dropdown-menu.show {
display: block
}

.dropdown-header {
display: block;
padding: .5rem 1.5rem;
margin-bottom: 0;
font-size: .875rem;
color: #6c757d;
white-space: nowrap
}

关于css - ng-bootstrap 打开焦点输入字段 css 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52922033/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com