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

问题描述 投票:0回答:1

我已经使用了ng Typeahead Open on focus输入,我的冲突是他们使用bootstrap-4但我已经使用bootstrap 3用于我的项目,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

css angular twitter-bootstrap-3 ng-bootstrap typehead
1个回答
1
投票

只需在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
}
© www.soinside.com 2019 - 2024. All rights reserved.