On this StackBlitz project: https://stackblitz.com/edit/ionic-react-demo-s368kk?file=App.jsx
I have the following code:
import React from 'react';
import { IonPage, IonContent, IonRow } from '@ionic/react';
const Button = ({ children }) => (
<div
style={{
display: 'inline-block',
backgroundColor: '#fff',
padding: '12px 22px',
margin: '10px 10px',
}}
>
<span>{children}</span>
</div>
);
const OptionsButtons = () => (
<div style={{ textAlign: 'center' }}>
<div>
<Button>This is your Option Number 1</Button>
</div>
<div>
<Button>This is your Option Number 2</Button>
</div>
</div>
);
const Delimiter = () => (
<div>
<span style={{ color: '#ff0' }}>==============================</span>
</div>
);
const App = () => (
<IonPage>
<IonContent
fullscreen
className=""
style={{
'--ion-background-color': 'none',
backgroundImage: `url('https://wallpaperaccess.com/full/1902544.jpg')`,
backgroundPosition: 'center',
backgroundSize: 'cover',
}}
>
<IonRow
style={{
height: '100%',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}
>
<OptionsButtons />
<Delimiter />
<OptionsButtons />
<Delimiter />
<OptionsButtons />
<Delimiter />
<OptionsButtons />
</IonRow>
</IonContent>
</IonPage>
);
export default App;
Normally the page looks like on the image below when it has enough space:
Note that the elements are vertically aligned (which is a requirement for me).
But if I decrease the viewport size, then the elmements get reorganized around and lost their initial position as you can see on the image below:
I really need the elements to keep their original position as when they had enough space. It doesn't matter if the user has to scroll down in order to see the elements beyond the fold. But remember that when there is enough space, I need the elements to be vertically aligned.
Any idea on how to solve this?
If you want you can post your forked StackBlitz.
Thanks!