diff --git a/app/client/src/layoutSystems/anvil/common/AnvilFlexComponent.tsx b/app/client/src/layoutSystems/anvil/common/AnvilFlexComponent.tsx index 8be56cfcb0..0c6520fd8d 100644 --- a/app/client/src/layoutSystems/anvil/common/AnvilFlexComponent.tsx +++ b/app/client/src/layoutSystems/anvil/common/AnvilFlexComponent.tsx @@ -157,6 +157,8 @@ export function AnvilFlexComponent(props: AnvilFlexComponentProps) { const styleProps: CSSProperties = useMemo(() => { return { position: "relative", + // overflow is set to make sure widgets internal components/divs don't overflow this boundary causing scrolls + overflow: "hidden", opacity: isDragging && isSelected ? 0.5 : 1, "&:hover": { zIndex: onHoverZIndex, diff --git a/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx b/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx index c66702b6bf..407e1f0608 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/component/TableStyledWrappers.tsx @@ -61,6 +61,10 @@ export const TableWrapper = styled.div<{ justify-content: space-between; flex-direction: column; overflow: hidden; + + /* wriiten exclusively for safari */ + position: sticky; + .simplebar-track { opacity: 0.7; &.simplebar-horizontal { diff --git a/app/client/src/widgets/wds/WDSTableWidget/widget/index.tsx b/app/client/src/widgets/wds/WDSTableWidget/widget/index.tsx index 7f66d1be19..2cc64df75b 100644 --- a/app/client/src/widgets/wds/WDSTableWidget/widget/index.tsx +++ b/app/client/src/widgets/wds/WDSTableWidget/widget/index.tsx @@ -138,6 +138,7 @@ import { ResponsiveBehavior, } from "layoutSystems/common/utils/constants"; import IconSVG from "../icon.svg"; +import { getAnvilWidgetDOMId } from "layoutSystems/common/utils/LayoutElementPositionsObserver/utils"; const ReactTableComponent = lazy(async () => retryPromise(async () => import("../component")), @@ -1180,7 +1181,12 @@ export class WDSTableWidget extends BaseWidget { getPaddingAdjustedDimensions = () => { // eslint-disable-next-line prefer-const - let { componentHeight, componentWidth } = this.props; + let { componentHeight } = this.props; + // Hacky fix for now to supply width to table widget + let componentWidth: number = + document + .getElementById(getAnvilWidgetDOMId(this.props.widgetId)) + ?.getBoundingClientRect().width || this.props.componentWidth; // (2 * WIDGET_PADDING) gives the total horizontal padding (i.e. paddingLeft + paddingRight) componentWidth = componentWidth - 2 * WIDGET_PADDING; return { componentHeight, componentWidth };