Skip to content

Commit

Permalink
Fix function configuration editor layout when shown as a side panel (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H authored Nov 28, 2024
1 parent aa12248 commit 825cff7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import AlertMessage from '../../UI/AlertMessage';
import useForceUpdate from '../../Utils/UseForceUpdate';
import Checkbox from '../../UI/Checkbox';
import { type ExtensionItemConfigurationAttribute } from '../../EventsFunctionsExtensionEditor';
import { useResponsiveWindowSize } from '../../UI/Responsive/ResponsiveWindowMeasurer';

const gd: libGDevelop = global.gd;

Expand Down Expand Up @@ -160,6 +161,7 @@ export const EventsFunctionPropertiesEditor = ({
}: Props) => {
const forceUpdate = useForceUpdate();
const [containerWidth, setContainerWidth] = React.useState<?number>(null);
const { isMobile } = useResponsiveWindowSize();

const type = eventsFunction.getFunctionType();
const isABehaviorLifecycleEventsFunction =
Expand Down Expand Up @@ -256,8 +258,9 @@ export const EventsFunctionPropertiesEditor = ({
<ResponsiveLineStackLayout
alignItems="center"
noMargin
// Allow to be displayed on a column when this component is in a side panel.
forceMobileLayout={!!containerWidth && containerWidth < 650}
noResponsiveLandscape
noResponsiveLandscape={isMobile}
>
<Line alignItems="center" noMargin>
<SelectField
Expand Down

0 comments on commit 825cff7

Please sign in to comment.