Skip to content

Commit 3f1ac0e

Browse files
committed
fix searchable-dropdown highlight clearing
1 parent a249e03 commit 3f1ac0e

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/primitive-field/primitive-field.component.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@
33
<tr [ngClass]="errorNgClass">
44
<ng-template #errorsTooltipTemplate>
55
<ul class="tooltip-left-align">
6-
<li *ngFor="let error of errors" >
6+
<li *ngFor="let error of errors">
77
{{error.message}}
88
</li>
99
</ul>
1010
</ng-template>
11-
<td class="value-container" [ngClass]="disabledClass" [tooltip]="errorsTooltipTemplate" [isDisabled]="!isErrorTooltipEnabled" placement="{{tooltipPosition}}" container="body">
11+
<td class="value-container" [ngClass]="disabledClass" [tooltip]="errorsTooltipTemplate" [isDisabled]="!isErrorTooltipEnabled"
12+
placement="{{tooltipPosition}}" container="body">
1213
<div *ngSwitchCase="'string'">
1314
<div [attr.contenteditable]="!disabled" attr.data-path="{{pathString}}" [tabindex]="tabIndex" [(contentModel)]="value" (blur)="commitValueChange()"
1415
(keypress)="onKeypress($event)" attr.placeholder="{{schema.title}}"></div>
1516
</div>
1617
<div *ngSwitchCase="'enum'">
1718
<searchable-dropdown [pathString]="pathString" [value]="value" [placeholder]="schema.title" [items]="schema.enum" [shortcutMap]="schema.enumShorcutMap"
18-
(onSelect)="onSearchableDropdownSelect($event)" [tabIndex]="tabIndex"></searchable-dropdown>
19+
(onSelect)="onSearchableDropdownSelect($event)" [tabIndex]="tabIndex" (onBlur)="domUtilService.clearHighlight()"></searchable-dropdown>
1920
</div>
2021
<div *ngSwitchCase="'autocomplete'">
2122
<autocomplete-input [pathString]="pathString" [value]="value" [path]="path" [autocompletionConfig]="schema.autocompletionConfig"

src/searchable-dropdown/searchable-dropdown.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="btn-group" dropdown keyboardNav="true" [isOpen]="status.isOpen" (onShown)="status.isOpen = true" (onHidden)="status.isOpen = false">
22
<div class="toggle-container" dropdownToggle>
33
<input #inputToggle attr.data-path="{{pathString}}" [placeholder]="placeholder" [(ngModel)]="expressionOrValue" (keypress)="onKeypress($event.key)"
4-
[tabindex]="tabIndex" (focus)="onFocus($event)">
4+
[tabindex]="tabIndex" (focus)="onFocus($event)" (blur)="onBlur.emit()">
55
<i class="fa fa-caret-down" (click)="inputToggle.focus()"></i>
66
</div>
77
<ul class="dropdown-menu" *dropdownMenu role="menu">

src/searchable-dropdown/searchable-dropdown.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export class SearchableDropdownComponent implements OnInit {
4242
status: { isOpen: boolean } = { isOpen: false };
4343

4444
@Output() onSelect = new EventEmitter<string>();
45+
@Output() onBlur = new EventEmitter<void>();
46+
4547

4648
ngOnInit() {
4749
this.placeholder = this.value || this.placeholder || '';

0 commit comments

Comments
 (0)