Skip to content

Commit

Permalink
fix(ui5-button): remove focus on phone and tablet (#4746)
Browse files Browse the repository at this point in the history
Focus outline removed on phone and tablet devices. Now "focused" attribute is placed only on Desktop devices.
  • Loading branch information
NHristov-sap committed Feb 15, 2022
1 parent a3bde22 commit 31915d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/main/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
isPhone,
isTablet,
isCombi,
isDesktop,
isSafari,
} from "@ui5/webcomponents-base/dist/Device.js";
import ButtonDesign from "./types/ButtonDesign.js";
Expand Down Expand Up @@ -436,7 +437,9 @@ class Button extends UI5Element {
return;
}
this.active = false;
this.focused = false;
if (isDesktop()) {
this.focused = false;
}
}

_onfocusin(event) {
Expand All @@ -445,7 +448,9 @@ class Button extends UI5Element {
}

event.isMarked = "button";
this.focused = true;
if (isDesktop()) {
this.focused = true;
}
}

get hasButtonType() {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,6 @@ bdi {
text-shadow: none;
}

:host([design="Transparent"]:not([active]):hover) {
:host([design="Transparent"]:not([active]):not([_is-touch]):hover) {
border-color: var(--sapButton_Lite_Hover_BorderColor);
}

0 comments on commit 31915d7

Please sign in to comment.