Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions packages/main/src/Panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import slideUp from "@ui5/webcomponents-base/dist/animations/slideUp.js";
import { isSpace, isEnter, isEscape } from "@ui5/webcomponents-base/dist/Keys.js";
import AnimationMode from "@ui5/webcomponents-base/dist/types/AnimationMode.js";
import { getAnimationMode } from "@ui5/webcomponents-base/dist/config/AnimationMode.js";
import { supportsTouch } from "@ui5/webcomponents-base/dist/Device.js";
import i18n from "@ui5/webcomponents-base/dist/decorators/i18n.js";
import type I18nBundle from "@ui5/webcomponents-base/dist/i18nBundle.js";
import type { UI5CustomEvent } from "@ui5/webcomponents-base";
Expand Down Expand Up @@ -199,6 +200,9 @@ class Panel extends UI5Element {
@property({ type: Boolean, noAttribute: true })
_pendingToggle = false;

@property({ type: Boolean })
_touched = false;

/**
* Defines the component header area.
*
Expand Down Expand Up @@ -232,6 +236,16 @@ class Panel extends UI5Element {
return this.noAnimation || getAnimationMode() === AnimationMode.None;
}

_isMobile() {
if (supportsTouch()) {
this._touched = true;
}
}

_headerFocusOut() {
this._touched = false;
}

_headerClick(e: MouseEvent) {
if (!this.shouldToggle(e.target as HTMLElement)) {
return;
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/PanelTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default function PanelTemplate(this: Panel) {
onClick={this._headerClick}
onKeyDown={this._headerKeyDown}
onKeyUp={this._headerKeyUp}
onTouchStart={this._isMobile}
onFocusOut={this._headerFocusOut}
class="ui5-panel-header"
tabindex={this.headerTabIndex}
role={this.accInfo.role}
Expand Down
6 changes: 5 additions & 1 deletion packages/main/src/themes/Panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@
right: var(--_ui5_panel_focus_offset);
}

:host(:not([collapsed]):not([_has-header]):not([fixed])) .ui5-panel-header:focus:after {
:host(:not([collapsed]):not([_has-header]):not([fixed])) .ui5-panel-header:focus::after {
border-radius: var(--_ui5_panel_border_radius_expanded);
}

:host([_touched]:not([_has-header]):not([fixed])) .ui5-panel-header:focus::after {
display: none;
}

:host(:not([collapsed])) .ui5-panel-header-button:not(.ui5-panel-header-button-with-icon),
:host(:not([collapsed])) .ui5-panel-header-icon-wrapper [ui5-icon] {
transform: var(--_ui5_panel_toggle_btn_rotation);
Expand Down
Loading