I have a 3 column table with angular. columns are domain-disable-actions and actions is a trash can icon button .
My problem is when mouse pointer comes onto the trash icon button, mouse pointer is becoming a cursor like a text box. How can i make it pointer on the icon ?
My working table code is here:
<mat-table #table [dataSource]="tableData">
<ng-container cdkColumnDef="domain">
<mat-header-cell *cdkHeaderCellDef fxFlex="50%">Domain</mat-header-cell>
<mat-cell *cdkCellDef="let config" fxFlex="50%">{{config.domain}}</mat-cell>
</ng-container>
<ng-container cdkColumnDef="disable">
<mat-header-cell *cdkHeaderCellDef fxFlex="30%">Disabled</mat-header-cell>
<mat-cell *cdkCellDef="let config" fxFlex="30%">{{config.disabled}}</mat-cell>
</ng-container>
<ng-container cdkColumnDef="button">
<mat-header-cell *cdkHeaderCellDef fxFlex="15%">Action</mat-header-cell>
<mat-cell *cdkCellDef="let config" fxFlex="15%">
<mat-icon (click)="deleteDomain(config)">delete_forever</mat-icon>
</mat-cell>
</ng-container>
<mat-header-row *cdkHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *cdkRowDef="let config; columns: displayedColumns;"></mat-row>
</mat-table>
Step 1: Click on the Search box located in the taskbar. Step 2: Type in "mouse." Step 3: Select Change your mouse settings from the resulting list of options to open the primary mouse settings menu. Step 4: Select Additional mouse options.
: to position (a computer cursor) over something (such as an image or icon) without selecting it Many in the class hovered their cursors over words and icons for long periods before committing to clicking their mouse.—
A CSS class is created that changes the cursor property. The cursor property is used to specify the mouse cursor to be displayed when the mouse is pointed over an element. Using the ‘pointer’ value in this property will change the cursor to a ‘pointer’ indicating a link.
Method 1: Using a CSS class for the links A CSS class is created that changes the cursor property. The cursor property is used to specify the mouse cursor to be displayed when the mouse is pointed over an element. Using the ‘pointer’ value in this property will change the cursor to a ‘pointer’ indicating a link.
All ng-clicks should have pointer as cursor except the ones that have X class (or any other CSS attribute) @Murilo, yes. For example, .x [ng-click] { cursor: default; } Does anyone know how to accomplish this in Angular 2? Angular 1 used ng-click whereas Angular 2 uses (click). For angular 2 have a look at stackoverflow.com/questions/58716247/…
You can use cursor: pointer CSS class, but i think you should use icon button in this case, simply like this: This will give you the pointer cursor with gray background color on select which means better user experience and less css classes. This one should be the accepted answer, if the question is about Angular >=2 and Angular Material usage.
You can use cursor: pointer
CSS class, but i think you should use icon button in this case, simply like this:
<button mat-icon-button (click)="doSomeThing()">
<mat-icon>delete_forever</mat-icon>
</button>
This will give you the pointer cursor with gray background color on select which means better user experience and less css classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With