Skip to content

Commit 0f69b84

Browse files
authored
fix(ui5-link): fix "click twice" issue in Safari (#1799) (#1800)
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
1 parent 78ee0ef commit 0f69b84

File tree

6 files changed

+5
-24
lines changed

6 files changed

+5
-24
lines changed

packages/main/src/themes/Link.css

+3-11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
font-family: var(--sapFontFamily);
1111
font-size: var(--sapFontSize);
1212
cursor: pointer;
13+
outline: none;
1314
}
1415

1516
:host([disabled]) {
@@ -65,16 +66,7 @@
6566
}
6667

6768
.ui5-link-root:focus {
69+
outline-offset: -1px;
70+
outline: 1px dotted var(--sapContent_FocusColor);
6871
text-decoration: underline;
6972
}
70-
71-
.ui5-link-root:focus::after {
72-
content: "";
73-
width: var(--_ui5_link_outline_element_size);
74-
height: var(--_ui5_link_outline_element_size);
75-
position: absolute;
76-
left: 0px;
77-
border: 1px dotted var(--sapContent_FocusColor);
78-
top: 0;
79-
outline: none;
80-
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
:root {
22
--_ui5_link_opacity: 0.5;
3-
--_ui5_link_outline_element_size: calc(100% - 0.125rem);
43
}

packages/main/src/themes/sap_belize_hcb/Link-parameters.css

-5
This file was deleted.

packages/main/src/themes/sap_belize_hcb/parameters-bundle.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@import "../base/GroupHeaderListItem-parameters.css";
1212
@import "./Input-parameters.css";
1313
@import "./InputIcon-parameters.css";
14-
@import "./Link-parameters.css";
14+
@import "../base/Link-parameters.css";
1515
@import "../base/List-parameters.css";
1616
@import "./ListItemBase-parameters.css";
1717
@import "./MonthPicker-parameters.css";

packages/main/src/themes/sap_belize_hcw/Link-parameters.css

-5
This file was deleted.

packages/main/src/themes/sap_belize_hcw/parameters-bundle.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@import "../base/GroupHeaderListItem-parameters.css";
1212
@import "./Input-parameters.css";
1313
@import "./InputIcon-parameters.css";
14-
@import "./Link-parameters.css";
14+
@import "../base/Link-parameters.css";
1515
@import "../base/List-parameters.css";
1616
@import "./ListItemBase-parameters.css";
1717
@import "./MonthPicker-parameters.css";

0 commit comments

Comments
 (0)