Skip to content

Commit

Permalink
Get proper unit if first column isn't auto
Browse files Browse the repository at this point in the history
  • Loading branch information
oakesjosh committed Dec 6, 2024
1 parent c85aed2 commit 42de5a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/blocks/table/components/backend-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export default function BackendStyles(props) {
const previewRowMinHeight = getPreviewSize(previewDevice, rowMinHeight, tabletRowMinHeight, mobileRowMinHeight);
const previewColumnSettingUnit = getPreviewSize(
previewDevice,
columnSettings?.[0]?.unit,
columnSettings?.[0]?.unitTablet,
columnSettings?.[0]?.unitMobile
columnSettings?.find((setting) => setting?.unit)?.unit,
columnSettings?.find((setting) => setting?.unitTablet)?.unitTablet,
columnSettings?.find((setting) => setting?.unitMobile)?.unitMobile
);

css.set_selector(`.kb-table${uniqueID}`);
Expand Down Expand Up @@ -113,9 +113,9 @@ export default function BackendStyles(props) {
if (!settings?.useAuto) {
const previewWidth = getPreviewSize(
previewDevice,
settings.width,
settings.widthTablet,
settings.widthMobile,
settings?.width,
settings?.widthTablet,
settings?.widthMobile,
true
);
css.set_selector(`.kb-table${uniqueID} tr > *:nth-child(${index + 1})`);
Expand Down
6 changes: 3 additions & 3 deletions src/blocks/table/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ export function Edit(props) {
};
const previewColumnSettingUnit = getPreviewSize(
previewDevice,
columnSettings?.[0]?.unit,
columnSettings?.[0]?.unitTablet,
columnSettings?.[0]?.unitMobile
columnSettings?.find((setting) => setting?.unit)?.unit,
columnSettings?.find((setting) => setting?.unitTablet)?.unitTablet,
columnSettings?.find((setting) => setting?.unitMobile)?.unitMobile
);

const StickyUpsell = (
Expand Down

0 comments on commit 42de5a2

Please sign in to comment.