Skip to content

bug: Chrome adding outline to focused ion-card button #21691

@Yohandah

Description

@Yohandah

Bug Report

I've found that adding a routerLink to a ion-card makes the card "focusable" and Chrome has a style on the card when it's in the "focus" state :
image

You can open the stackblitz linked on Firefox and when you press a card there is no black border while on chrome there is.

Sans titre

Maybe ionic should override this Chrome :hover style to reset it by default ? I added this in my styles.global.scss :

// reset chrome style
ion-card:focus {
  outline: none;
}

I'm also able to fix this by setting a (click) event then navigate with NavController instead of a RouterLink

Ionic version:
[x] 5.x

Related code:

https://ionic-v5-base-test-bordures.stackblitz.io

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions