Skip to content

Commit

Permalink
fix(ui5-flexible-column-layout): adjust grip minimum target size (#10743
Browse files Browse the repository at this point in the history
)

- Problem:
The grip did not meet the minimum target size requirements.

- Solution:
Add a container div around the grip icon to control the minimum target size, setting it to 1.5rem width and 2rem height.

- Explanation:
Restructured the grip to handle width and height at the div level instead of the icon because the .ui5-icon-root class (which gets automatically applied to icons) sets width and height to 100%. Applying the dimensions directly to the icon would cause it to stretch and fill the entire available space, distorting its proportions.

Fixes: #10669
  • Loading branch information
NakataCode authored Feb 4, 2025
1 parent 859b7ff commit aa58291
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
22 changes: 14 additions & 8 deletions packages/fiori/src/FlexibleColumnLayoutTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,26 @@ function arrowStart(this: FlexibleColumnLayout) {

function gripStart(this: FlexibleColumnLayout) {
return (
<Icon
name={verticalGripIcon}
<div
class="ui5-fcl-grip ui5-fcl-grip--start"
style={{ display: this.showStartSeparatorGrip ? "inline-block" : "none" }}
/>
style={{ display: this.showStartSeparatorGrip ? "flex" : "none" }}>
<Icon
name={verticalGripIcon}
class="ui5-fcl-grip-icon"
/>
</div>
);
}

function gripEnd(this: FlexibleColumnLayout) {
return (
<Icon
name={verticalGripIcon}
<div
class="ui5-fcl-grip ui5-fcl-grip--end"
style={{ display: this.showEndSeparatorGrip ? "inline-block" : "none" }}
/>
style={{ display: this.showEndSeparatorGrip ? "flex" : "none" }}>
<Icon
name={verticalGripIcon}
class="ui5-fcl-grip-icon"
/>
</div>
);
}
18 changes: 13 additions & 5 deletions packages/fiori/src/themes/FlexibleColumnLayout.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
/* separator */
.ui5-fcl-separator {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 1rem;
Expand All @@ -50,13 +51,20 @@
border:var(--_ui5_fcl_separator_focus_border);
outline: none;
}

.ui5-fcl-grip {
cursor: col-resize;
overflow: visible;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
width: 1.5rem;
height: 2rem;
z-index: 10;
}

.ui5-fcl-grip-icon {
color: var(--sapButton_TextColor);
padding-top: 0.3125rem;
padding-bottom: 0.3125rem;
}

.ui5-fcl-arrow {
Expand Down Expand Up @@ -101,8 +109,8 @@
}

/* Only apply shorter height when arrow is visible */
.ui5-fcl-separator:hover .ui5-fcl-arrow + .ui5-fcl-grip::before {
height: calc(40% - 1rem);
.ui5-fcl-separator:hover .ui5-fcl-arrow + .ui5-fcl-grip::before {
height: calc(40% - 1rem);
}

[aria-hidden] ::slotted([slot="startColumn"]),
Expand Down

0 comments on commit aa58291

Please sign in to comment.