components icon indicating copy to clipboard operation
components copied to clipboard

Misleading click feedback in complex md-nav-list

Open atd opened this issue 9 years ago • 4 comments

Bug, feature request, or proposal:

UX related bug

What is the expected behavior?

When the user clicks a link in a md-list-item inside a complex md-nav-list, the link should be activated

What is the current behavior?

When the user clicks the link close to the edge, she obtains the feedback (the ripple effect is fired) but the link does not get the click event

What are the steps to reproduce?

Use the template provided at https://material.angular.io/components/component/list#navigation-lists (For more complex navigation lists...) or visit http://plnkr.co/edit/oqGfqlDTYRLF4bOSHQGv?p=preview

Click at the edges of the elements of the list.

What is the use-case or motivation for changing an existing behavior?

An UX issue; users get the feedback when they click but the app does not fire the action

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Tested with Chromium 58.0.3029.81 and Firefox 45.9.0

Is there anything else we should know?

The following gif shows how the mat-list-text element (container of the <a> element ) is smaller than the mat-list-item element. Therefore, it doesn't get the click event

element-sizes

atd avatar Jun 14 '17 17:06 atd

Agreed, this behaviour is confusing

agpreynolds avatar Jun 30 '17 08:06 agpreynolds

I also got this problem, very confusing, here is my plunker with a md-nav-list containing an icon, link and button: https://plnkr.co/edit/9HDykcCwiNugXLh5OQVi?p=preview

bildschirmfoto 2017-07-18 um 16 29 21

The problem is that the cursor is changed to the pointing hand and on click the ripple effect triggers, but not the action.

I tried also setting <md-list-item (click)="..."> or <md-list-item [routerLink]="...">, but then then the button event is not triggering anymore.

BaimosTechnologies avatar Jul 18 '17 14:07 BaimosTechnologies

Workaround fix using event.stopPropagation() until this issue is fixed: https://plnkr.co/edit/9HDykcCwiNugXLh5OQVi?p=preview

<md-nav-list>
  <md-list-item *ngFor="let folder of folders" (click)="clickListItem(folder)">
    <md-icon md-list-icon>folder</md-icon>
    <a md-line>{{folder.name}}</a>
    <button md-icon-button (click)="clickListItemButton(folder, $event)">
      <md-icon>info</md-icon>
    </button>
  </md-list-item>
</md-nav-list>
  clickListItem(folder: any): void {
    alert('List Item "' + folder.name + '" was clicked');
  }
  
  clickListItemButton(folder: any, event?: Event): void {
    if (event) {
      event.stopPropagation();
    }

    alert('Button "' + folder.name + '" was clicked');
  }

BaimosTechnologies avatar Aug 02 '17 10:08 BaimosTechnologies

@BaimosTechnologies, I've fixed your plunker https://plnkr.co/edit/ex2D9u8lx5DNgRY21KE6?p=preview In adition, when user clicks on md-icon-button it applies ripple effect to whole list-item, however handler for list-item is not fiered. So as a user I would expect ripple effect to not appear for the list-item. What do you think?

Nodarii avatar Sep 07 '17 15:09 Nodarii