我有一个 Angular (10) Material 复选框,标签中带有一个链接,该链接有一个单击处理程序来打开包含参考信息的对话框:
<mat-checkbox formControlName="certification">
By checking this box, I certify that all shipment information provided is correct and I agree to adhere to the
<span class="fake-link" (click)="openUspsPrivacyAgreement($event)"> USPS Privacy Act Statement </span> and all
other country-specific requirements.
</mat-checkbox>
我的点击处理程序是
openUspsPrivacyAgreement(event: MouseEvent) {
this.dialogService.open(DialogUspsPrivacyAgreementComponent);
event.preventDefault();
event.stopPropagation();
}
它的工作原理是对话框打开并且复选框未被选中,这正是我想要的。
然而,无论如何,涟漪都会在复选框上触发。有没有办法在我单击文本时防止出现波纹,但在单击复选框时使其起作用?
我认为我所做的已经足够了,因为它确实阻止了点击到达复选框并选中它。
弑天下
芜湖不芜
相关分类