Expanding the navigation bar is causing a hindrance to clicking on input fields

Upon clicking the navbar to extend it, I encountered an issue where I couldn't interact with inputs and buttons on my website. Upon further investigation, I discovered that this problem was linked to the navbar itself. Removing the navbar resolved the interaction issues on the site. It seems there might be an issue with how the navbar extension is implemented as certain elements become only partially clickable. For example, on the addNote page, the last input box functions correctly but only half of it is clickable.

View the AddNote page here

Below is the CSS code for the menu:

.menu{
  background: red;
  width:100%;
  min-height:10vh;
  position: fixed;
  left:0px;
  top:0px;
  z-index: 10;
  border-bottom: 0.4px solid #C0C5CD;
  transition: 0.3s ease-in-out;
  cursor: pointer;
}
.menu-item{
  font-size:0em;
  color:black;
  margin-top: 1.2vh;
  display:block;
  opacity:0;
  height: 0px;
  transition: 0.3s ease-in-out;
  border-bottom: 0.7px solid #C0C5CD;
  background:red;
  display: none;
}
.menu-item-extend{
  opacity:1;
  height: 5.5vh;
  font-size: 1.6em;
  display: block;
}
.noStyle{
  border: none;
}

And here is the HTML code for the menu (using React v4):

import { Meteor } from "meteor/meteor"
import React from "react";
import { withRouter, Link } from "react-router-dom";

import { SubjectRoutes } from "../subjectRoutes/subjectRoutes";
import "../../../client/stylesheets/authentication.css"

class Menu extends React.Component{
  extendMenu(){
    let menuItems = document.querySelectorAll(".menu-item");
    for(let i = 0; i <= menuItems.length; i++ ){
      menuItems[i].classList.toggle("menu-item-extend") 
    }
    console.log(menuItems)
  }
  render(){
    return(
      <div className="center center-v-outer">
        <div className="menu center-v-inner" ref="menu" onClick={this.extendMenu.bind(this)}>
          <h1 className="menu-header">PostNote</h1>
          <p className="menu-item"><Link to="/">Home</Link></p>
          <p className="menu-item"><Link to="/searchNotes">Notes</Link></p>
          <p className="menu-item"><Link to="/addNote">Add a Note</Link></p>
          <p className="menu-item noStyle"><Link to={`/users/${Meteor.userId()}`} >My Profile</Link></p>
        </div>
      </div>
    );
  }
}
export default withRouter(Menu)

Answer №1

The form is being obstructed by your wrapper div.center.center-v-outer because of the 'height: 50vh' property on .center-v-outer. Simply removing this should resolve the issue.

Furthermore, it may be a good idea to separate the menu from the form for better organization.

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

Having trouble with jQuery validation: Seeking clarification on the error

I have implemented some validations on a basic login page and added jQuery validation upon button click. However, the code is not functioning as expected. I have checked the console for errors but none were displayed. Here is the code for your review: ...

Trigger the function in ng-change each time the same option is clicked repeatedly

Here is the code I am working with: angular.module("myApp", []).controller("myController", function($scope) { $scope.currentOption; $scope.showWindow = false; $scope.myOptions = [{ id: 1, name: 'This opens the window' }, { ...

Unable to locate the JavaScript/jQuery key

Struggling with a dictionary in JavaScript being passed to a function in Django. Despite the key existing, I'm getting an error saying 'key message not found'. As a newbie in Javascript and JQuery, I must have made a simple mistake somewhere ...

unable to transfer Vuex store information to the graph

Currently, I am facing an issue with passing my vuex store data into my apexcharts graph. Despite my efforts, it seems like the data is not being displayed correctly. Can anyone provide guidance on what I might be doing wrong? My main objective is to updat ...

Issue with Vue.js: document.querySelector is returning a null value even though the element clearly exists

I'm currently working on implementing a responsive navbar following Kevin Powell's tutorial, but I've run into an issue. For some reason, when I try to select the element with the class 'primary-navigation' using 'const primar ...

The contact us page's layout issue cannot be resolved by adjusting the left and right borders of the parent div

https://i.sstatic.net/Gj7mQ.png <div class="col s1 m-5" style="background-color: white"> <div id="gd1" style="background-color: aqua;width: 100%;align-items: center;height: 20%;border-radius: 1% 1% 0 0;margin ...

Tips for showcasing unprocessed JSON information on a webpage

Similar Question: JSON pretty print using JavaScript I am looking to present my raw JSON data on an HTML page similar to how JSONView displays it. Here is an example of my raw JSON data: { "hey":"guy", "anumber":243, "anobject":{ "whoa ...

Guide on how to link a prop to a ref in Vue 3.0 without modifying the prop value

When passing a prop user from the parent component to the child component, I want to create a separate copy of it without altering the original prop value. I attempted to achieve this with the following code: export default defineComponent({ props: { ...

VueJS with Vuetify: Issue with draggable cards in a responsive grid

I am currently working on creating a gallery that allows users to rearrange images. To test this functionality, I am using an array of numbers. It is important that the gallery is responsive and displays as a single column on mobile devices. The issue I ...

Utilizing AJAX to retrieve data from a MySQL database upon clicking a button

Hello everyone, I am fairly new to the world of PHP and AJAX, so please bear with me. I am currently attempting to retrieve MySQL results using AJAX. I have made some progress thanks to the information I have gathered from various sources on the internet. ...

Is there a way to smoothly navigate back to the top within a Modal component while using React?

Here is the code snippet for scrolling back to the top of the page. const ScrollToTop = () => { const [showTopButton, setShowTopButton] = useState(false); useEffect(() => { window.addEventListener("scroll", () => { if ( ...

Using Angular JS to manage multiple views with a single controller

Would it be considered best practice to use one controller, yet have two distinct HTML file templates that present the same data in different formats? Essentially, I require a slightly altered template for displaying content in a modal dialog and another ...

Error message: Component is unable to access the $store property because it is undefined

After doing extensive research and reading numerous similar questions on various platforms, I am still unable to resolve my issue. I have a component containing a login form that triggers a method to dispatch a $store action for logging in the user via fi ...

Utilizing Firebase authentication to sign in via phone number in conjunction with Express on Node.js

Encountering an issue while implementing backend Firebase Authorization. After thoroughly reading the documentation (https://firebase.google.com/docs/auth/web/phone-auth), I came to understand that Authorization requires two steps: send phone send code ...

Identify and click on the child span within the li element using Cypress

I am struggling to select a li element and click/check on the span with the checkbox class, but I can't seem to make it work. Here is what I have attempted: <div id="list-widget"> <ul class="tree"> <li class ...

Headers can't be set after they have been sent. This issue arises when calling create(data,cb) function

I am a beginner in Node.js and I am attempting to create a model in MongoDB. However, when I make a call to localhost:3000/a, I notice that the request is being sent twice in the console and I am encountering an error stating "Can't set headers after ...

Looking to send information to a different website and get the response back using JavaScript?

Seeking assistance: I'm attempting to post my University seat number, 1da07cs102, to http://results.vtu.ac.in/results.php. This website uses rid as a name in form. How can I use JavaScript to retrieve my results from the specified site and display the ...

Difficulty filling height with Bootstrap 4 flex-grow

I am in need of creating a layout with a header div at the top (that can be filled with content), a footer div at the bottom, and a middle div with an adaptable height to fill the entire screen. Check out my code below: <div class="container-fluid p-0 ...

How to Handle an Empty Route with a Trailing Slash in Backbone Routing?

While I am aware of the potential SEO issues that come with duplicate content, my project is not currently focused on that aspect. Looking at my backbone router configuration, here it is: routes: { "": "startOrder", "order/:orderNumber/:stepName" ...

An issue has been encountered in the code during the installation of react.js

node:internal/modules/cjs/loader:1148 throw err; ^ Error: Module 'C:\Users\hp\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js' could not be found. at Module._resolveFilename (node:internal ...