Skip to content

Commit

Permalink
fix(ui5-link): fix "click twice" issue in Safari (#1799) (#1800)
Browse files Browse the repository at this point in the history
The usage of pseudo elements such as ::after, ::before has side effects on iOs/macOS making the first click to just focus the element and the second to be registered as click. Now, we set the focus with outline, instead of pseudo element. Note: in IE, the focus will be 1px wider on all sides, compared to Safari, Chrome and FF as the outline-offset is not supported.

FIXES: #1796
  • Loading branch information
ilhan007 committed Jun 15, 2020
1 parent 9565f76 commit 16987eb
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 24 deletions.
14 changes: 3 additions & 11 deletions packages/main/src/themes/Link.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
font-family: var(--sapFontFamily);
font-size: var(--sapFontSize);
cursor: pointer;
outline: none;
}

:host([disabled]) {
Expand Down Expand Up @@ -65,16 +66,7 @@
}

.ui5-link-root:focus {
outline-offset: -1px;
outline: 1px dotted var(--sapContent_FocusColor);
text-decoration: underline;
}

.ui5-link-root:focus::after {
content: "";
width: var(--_ui5_link_outline_element_size);
height: var(--_ui5_link_outline_element_size);
position: absolute;
left: 0px;
border: 1px dotted var(--sapContent_FocusColor);
top: 0;
outline: none;
}
1 change: 0 additions & 1 deletion packages/main/src/themes/base/Link-parameters.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
:root {
--_ui5_link_opacity: 0.5;
--_ui5_link_outline_element_size: calc(100% - 0.125rem);
}
5 changes: 0 additions & 5 deletions packages/main/src/themes/sap_belize_hcb/Link-parameters.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@import "../base/GroupHeaderListItem-parameters.css";
@import "./Input-parameters.css";
@import "./InputIcon-parameters.css";
@import "./Link-parameters.css";
@import "../base/Link-parameters.css";
@import "../base/List-parameters.css";
@import "./ListItemBase-parameters.css";
@import "./MonthPicker-parameters.css";
Expand Down
5 changes: 0 additions & 5 deletions packages/main/src/themes/sap_belize_hcw/Link-parameters.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@import "../base/GroupHeaderListItem-parameters.css";
@import "./Input-parameters.css";
@import "./InputIcon-parameters.css";
@import "./Link-parameters.css";
@import "../base/Link-parameters.css";
@import "../base/List-parameters.css";
@import "./ListItemBase-parameters.css";
@import "./MonthPicker-parameters.css";
Expand Down

0 comments on commit 16987eb

Please sign in to comment.