Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-button): now the hover state in the combi device changes color #4100

Merged
merged 6 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/base/hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MqYJwSsMbglsBVErBjlj4MODyjI=
UCwN/PUSISQq4XJPl09FycIXqSY=
5 changes: 5 additions & 0 deletions packages/base/src/Device.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ const isDesktop = () => {
return (!isTablet() && !isPhone()) || isWindows8OrAbove();
};

const isCombi = () => {
return isTablet() && isDesktop();
};

export {
supportsTouch,
isIE,
Expand All @@ -99,4 +103,5 @@ export {
isPhone,
isTablet,
isDesktop,
isCombi,
};
4 changes: 2 additions & 2 deletions packages/main/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isSpace, isEnter } from "@ui5/webcomponents-base/dist/Keys.js";
import { getFeature } from "@ui5/webcomponents-base/dist/FeaturesRegistry.js";
import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
import isLegacyBrowser from "@ui5/webcomponents-base/dist/isLegacyBrowser.js";
import { isPhone, isTablet } from "@ui5/webcomponents-base/dist/Device.js";
import { isPhone, isTablet, isCombi } from "@ui5/webcomponents-base/dist/Device.js";
import ButtonDesign from "./types/ButtonDesign.js";
import ButtonTemplate from "./generated/templates/ButtonTemplate.lit.js";
import Icon from "./Icon.js";
Expand Down Expand Up @@ -323,7 +323,7 @@ class Button extends UI5Element {
}

onEnterDOM() {
this._isTouch = isPhone() || isTablet();
this._isTouch = (isPhone() || isTablet()) && !isCombi();
}

onBeforeRendering() {
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/themes/Button.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ bdi {
border-color: var(--sapButton_Lite_BorderColor);
}

:host([design="Transparent"]:not([active]):not([non-interactive]):not([_is-touch]):hover){
:host([design="Transparent"]:not([active]):not([non-interactive]):not([_is-touch]):hover) {
background-color: var(--sapButton_Lite_Hover_Background);
}

/*The ui5_hovered class is set by FileUploader to indicate hover state of the control*/
:host([design="Transparent"]:not([active]):not([non-interactive]):not([_is-touch]).ui5_hovered){
:host([design="Transparent"]:not([active]):not([non-interactive]):not([_is-touch]).ui5_hovered) {
background-color: var(--sapButton_Lite_Hover_Background);
border-color: var(--sapButton_Lite_Hover_BorderColor);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/theme-base/hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
wM02nFDjONftitW7w0jdwn6mq1w=
dGhgDCYR9qOD5V4LXfTTQLw/dHQ=