繁体   English   中英

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

[英]ng-bootstrap Open on focus input field css not working

在焦点输入使用了ng Typeahead Open ,我的冲突是他们正在使用bootstrap-4但我在项目中使用了bootstrap 3,而在on open上使用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代码

只需在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 } 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM