Skip to content

Commit c73c531

Browse files
committed
use preventDefault() to prevent scroll to top due to href="#"
1 parent 6dedb89 commit c73c531

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frameworks/keyed/angular-cf-signals/src/app/app.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1>Angular Signals keyed</h1>
3333
<tr [class.danger]="item.id === selected()">
3434
<td class="col-md-1">{{item.id}}</td>
3535
<td class="col-md-4">
36-
<a href="#" (click)="selected.set(item.id)">{{item.label}}</a>
36+
<a href="#" (click)="$event.preventDefault(); selected.set(item.id)">{{item.label}}</a>
3737
</td>
3838
<td class="col-md-1"><a href="#" (click)="delete(item.id)"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>
3939
<td class="col-md-6"></td>

0 commit comments

Comments
 (0)