Changing the direction to reverse column will cause the navigation component to be hidden

Issue: The <Navigation/> components disappear when using flex-direction: column-reverse.

However, if I switch to flex-direction: column, the component appears at the top of the screen and is visible.

My objective is to display my <Navigation/> component as a bottom navigation bar, similar to an iPhone app.

Below is my code snippet:

<div className="app">
      <Router>
        <div className="navigation__wrapper">
          <Navigation />
        </div>
        <div className="route__wrapper">
          <AppWrapper>
            <Switch>
              <Route
                exact
                path="/"
                render={() => (
                  <MainLayout>
                    <Homepage />
                  </MainLayout>
                )}
              />

            
            </Switch>
          </AppWrapper>
        </div>
      </Router>
    </div>

Here is the CSS used:

.app {
  -ms-overflow-style: none;
  scrollbar-width: none;
  background-color: var(--main-background);
  font-family: "Poppins";
  max-width: 100vw;
  min-width: 100vh;
  display: flex;
  flex-direction: column-reverse;
}

Answer №1

When using flex-direction: column-reverse, not only does it reverse the order of the column, but also the placement. For example, if align-items and justify-content are both set to flex-start (their initial value) and your flex items do not have a combined height that is at least as big as the flexbox container, they will all move to the bottom left corner instead of staying at the top left corner as you might expect. You can resolve this issue by implementing the following code...

.app {
  -ms-overflow-style: none;
  scrollbar-width: none;
  background-color: var(--main-background);
  font-family: "Poppins";
  max-width: 100vw;
  min-width: 100vh;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  justify-content: flex-end;
}

Alternatively, you could keep flex-direction: column and relocate the div containing the navigation below route__wrapper.

I created a web app that may assist you in understanding Flexbox better. Check it out here:

Keep in mind that this solution may not be comprehensive without examining your entire codebase.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Color Theme in Electron React with Material UI

Recently integrated electron and React with Material UI into my project. I am facing an issue with the color property in the app-bar component, as it is removing all colors and displaying it as white. Even though I copied the code from the documentation, I ...

There has been a TypeError caught: `{(intermediate value)}` is not functioning as intended

Having trouble with the error message "Uncaught TypeError: {(intermediate value)} is not a function" when I come across this line of code; export default connect( mapStateToProps, { fetchSurveys }(SurveyList)); I'm unsure what's causi ...

I am struggling to get the pop-up to close using the current code. I suspect that the issue might be related to the variable I was previously using in WordPress. I have made changes but the pop-up

While delving deeper into the realm of Javascript, I encountered a stumbling block with a single popup intended for the main page of a WordPress website I am constructing. Despite my attempts to modify the code's variables, they seem unyielding. Surpr ...

Troubleshooting steps for resolving an issue encountered when attempting to install modules using npm in a React application

After encountering issues while attempting to install certain npms, I took the step of deleting the entire node_modules folder in order to reinstall it with the hope of resolving the problem. Before deleting the folder, my project was functioning properly ...

What is causing my Bootstrap Controls to malfunction?

I'm trying to create a Bootstrap carousel that shows 3 items at once and includes controls to switch between them. The carousel I've made does display the three items, but for some reason, the controls are not responding when clicked. I'm un ...

Guide to deploying a React Application to Netlify while organizing the client and server directories

I'm facing some confusion while attempting to deploy an application to Netlify that consists of both client and server folders. I initially tried running npm build on the main directory which contains both folders, but it did not yield the desired res ...

Retrieving theme variables from a prior session in createMuiTheme

Utilizing Material UI version 1.0.0-beta.24 I am currently implementing a new theme using the method createMuiTheme: import {createMuiTheme} from 'material-ui/styles'; const theme = createMuiTheme({ typography: { fontSize: 16 } }); ex ...

Guide on passing a JSON body as a string in a PUT API request using Fetch in a React.js application

How can I pass a JSON body as a string in a FETCH PUT API in React JS? I am attempting to add 20 to the Balance like this: Balance: details[0].Balance.toString() + 20, but it is not working as expected. I want the entire result to be a string. Any assista ...

The Material-UI Select Component is having trouble selecting an option - it timed out and is retrying after 4000ms

During my integration tests for a React component using Cypress, I've hit a roadblock when trying to select an option from a Material-UI Select component within a dialog. The issue arises even though I can successfully log in and open the dialog. Her ...

Google has not detected any hreflang return tag

My website has encountered indexing errors on Google Search Console. According to the reports, many pages are showing an alternate version in a different language without the "return tag". This "return tag" is believed to be the pointer back to the origina ...

Guide to building a nested React component

My custom dropdown component requires 2 props: trigger (to activate the dropdown) list (content to display in the dropdown) Below is the implementation of my component: import { useLayer } from "react-laag"; import { ReactElement, useState } fr ...

Having trouble establishing a connection between the client and server while using Node.js with socket.io, Express, and an HTML file

While following a tutorial on YouTube for creating a simple web game with lobbies/rooms, I encountered an issue. When attempting to establish a connection between the client and server, the expected "a user connected" text did not show up in the console as ...

Enhancing dynamic text boxes with jQuery by incorporating additional information

I've recently developed an interactive app that dynamically creates tables based on user input. The app includes a feature where you can specify the number of tables to generate and track the total count of tables added. Currently, I'm exploring ...

Is it possible to iterate through a nested object with a dynamic number of fields?

{ "pagesections": [ { "title": "Leadership Team", "sections": [ { "title": "Co-Founders/Co-Presidents", ...

Customizing Bootstrap Navbar: Ensuring the External Search Bar is displayed correctly within the expanded navbar

In my Bootstrap 5 navbar, I have a search bar, notifications dropdown, and collapsible buttons. How can I ensure that the search bar is visible in the expanded version of the navbar and hidden when the navbar is collapsed, while keeping the notifications d ...

What could be causing the HTML <DATALIST> dropdown to display next to its input rather than below it?

I have an input linked to a datalist, and it's functioning correctly. However, when I initially open the dropdown, the option list appears next to (right of) the input. After entering a few characters to narrow down the list, it then shifts below the ...

Updating a string's value in Angular based on user input

I am currently developing a custom offer letter template that will dynamically update key data points such as Name, Address, Role, Salary, etc based on the selected candidate from a list. The dynamic data points will be enclosed within <<>> in ...

Including variables in package.jsonORInjecting variables into package

I'm currently developing a React application and I am trying to figure out how to pass a variable from the .env file into package.json: {"proxy": "ENV_VAR"} Is there a way to achieve this? In addition, our app is built using Docker. Is it possible ...

Ways to display a vertical scrollbar within a select box

I'm currently working with an Angular select box and I'm looking to display a scroll bar if there are more than 5 data entries. <select class="form-control" data-ng-model='projectListData.appVersion' ng-selected ng-options="v.versio ...

Troubleshooting ElasticSearch and Next.js: Error Encountered - Unable to locate module 'async_hooks'

I am working on building a basic NextJS frontend that connects to an Elasticsearch backend. To achieve this, I have opted for the ElasticsearchJS library, which can be found here: ElasticsearchJS. The project is a standard vanilla NextJS setup created usi ...