Skip to content
Snippets Groups Projects
Commit 343a1498 authored by Yana De Pauw's avatar Yana De Pauw
Browse files

Prevent navigation by link from collection-list component

parent 228a61e7
No related merge requests found
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
<div class="autocomplete dropdown-menu" [ngClass]="{'show': (show | async) && isNotEmpty(suggestions)}"> <div class="autocomplete dropdown-menu" [ngClass]="{'show': (show | async) && isNotEmpty(suggestions)}">
<div class="dropdown-list"> <div class="dropdown-list">
<div *ngFor="let suggestionOption of suggestions"> <div *ngFor="let suggestionOption of suggestions">
<a href="#" class="d-block dropdown-item" (click)="onClickSuggestion(suggestionOption)" #suggestion> <button class="d-block dropdown-item" (click)="onClickSuggestion(suggestionOption)" #suggestion>
<div class="click-blocker">
</div>
<ds-wrapper-list-element [object]="suggestionOption"></ds-wrapper-list-element> <ds-wrapper-list-element [object]="suggestionOption"></ds-wrapper-list-element>
</a> </button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -60,7 +60,7 @@ describe('DsoInputSuggestionsComponent', () => { ...@@ -60,7 +60,7 @@ describe('DsoInputSuggestionsComponent', () => {
const clickedIndex = 0; const clickedIndex = 0;
beforeEach(() => { beforeEach(() => {
spyOn(comp, 'onClickSuggestion'); spyOn(comp, 'onClickSuggestion');
const clickedLink = de.query(By.css('.dropdown-list > div:nth-child(' + (clickedIndex + 1) + ') a')); const clickedLink = de.query(By.css('.dropdown-list > div:nth-child(' + (clickedIndex + 1) + ') button'));
clickedLink.triggerEventHandler('click', {}); clickedLink.triggerEventHandler('click', {});
fixture.detectChanges(); fixture.detectChanges();
}); });
......
.autocomplete { .autocomplete {
width: 100%; width: 100%;
.dropdown-item { .dropdown-item {
white-space: normal; white-space: normal;
word-break: break-word; word-break: break-word;
padding: $input-padding-y $input-padding-x; padding: $input-padding-y $input-padding-x;
position: relative;
&:focus { &:focus {
outline: none; outline: none;
} }
.click-blocker {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment