Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular trash icon is changing mouse pointer to a cursor

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>
like image 825
abidinberkay Avatar asked Jan 21 '19 16:01

abidinberkay


People also ask

How do I change my mouse cursor back to normal?

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.

What is hover cursor?

: 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.—

How do I change the cursor in CSS?

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.

How do I change the cursor of 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.

Should all ng-clicks have a pointer as cursor?

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/…

How to make a mouse cursor with a gray background color?

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.


1 Answers

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.

like image 95
Nimer Esam Avatar answered Sep 24 '22 19:09

Nimer Esam