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
Branches
Tags
No related merge requests found
......@@ -13,9 +13,11 @@
<div class="autocomplete dropdown-menu" [ngClass]="{'show': (show | async) && isNotEmpty(suggestions)}">
<div class="dropdown-list">
<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>
</a>
</button>
</div>
</div>
</div>
......
......@@ -60,7 +60,7 @@ describe('DsoInputSuggestionsComponent', () => {
const clickedIndex = 0;
beforeEach(() => {
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', {});
fixture.detectChanges();
});
......
.autocomplete {
width: 100%;
.dropdown-item {
white-space: normal;
word-break: break-word;
padding: $input-padding-y $input-padding-x;
position: relative;
&:focus {
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