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

Stable cell action icon when pressed #2106

Merged
merged 6 commits into from
Oct 8, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -2043,8 +2043,8 @@ export class KupDataTable {

// in case a cell action icon is clicked
if (
details.cell.obj.t !== 'J4' &&
details.cell.obj.p !== 'ICO'
details?.cell?.obj?.t !== 'J4' &&
details?.cell?.obj?.p !== 'ICO'
) {
break;
}
Expand Down
27 changes: 15 additions & 12 deletions packages/ketchup/src/f-components/f-cell/f-cell.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
max-height: 100%;
}

&:hover {
.f-image.f-cell__iconfunction.right,
.f-image.f-cell__iconfunction.left {
opacity: 1;
background-color: var(--kup-gray-color-10-hover);
z-index: 2;
}
}
.f-cell__content {
align-items: center;
display: flex;
Expand All @@ -48,13 +56,17 @@
transition: opacity 0.3s ease;

&.right {
right: 0;
right: 0;
}

&.left {
left: 0;
left: 0;
}
}

&:focus-within {
opacity: 1;
}
}
img,
.f-image {
margin: 0;
Expand All @@ -69,15 +81,6 @@
}
}

&:hover {
.f-image.f-cell__iconfunction.right,
.f-image.f-cell__iconfunction.left {
opacity: 1;
background-color: var(--kup-gray-color-10-hover);
z-index: 2;
}
}

.f-cell__text {
overflow: hidden;
text-overflow: ellipsis;
Expand Down
1 change: 1 addition & 0 deletions packages/ketchup/src/f-components/f-cell/f-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export const FCell: FunctionalComponent<FCellProps> = (
cellType === FCellTypes.NUMBER ? 'left' : 'right'
}`}
onClick={props.cellActionIcon.onClick}
tabIndex={0}
/>
)}
{children && children.length > 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface FImageProps extends FComponent {
sizeY?: string;
onClick?: (event: MouseEvent) => void;
onLoad?: (event: Event) => void;
tabIndex?: number;
}
/**
* The object of a single step of CSS when the f-image is in CSS-drawing mode.
Expand Down
1 change: 1 addition & 0 deletions packages/ketchup/src/f-components/f-image/f-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const FImage: FunctionalComponent<FImageProps> = (
style={style}
title={props.title}
onClick={props.onClick}
tabindex={props.tabIndex ?? null}
>
{props.placeholderResource
? createIcon(
Expand Down