Some Child React Components not working

Samkit Shah

Everything I have added to My react Component below the header is not functional/not clickable/not working I didn't come across any bugs. Similar child components seem to work on other components. I have used styled components and material-ui. Here is my code on Github --> You can see my Contact_Us component https://github.com/SamkitS/showell/blob/master/src/components/Contact_Us.js

      class Contact extends React.Component {
constructor (props) {
    super(props);
    this.state = {
        markers: [{
            position : {
                lat:19.204729,
                lng: 72.836778,
            }
        }]
    }
}


render () {
    return (
    <Wrapper >

        <header>

        <MuiThemeProvider muiTheme={getMuiTheme()}>
        <CommonBar />
        </ MuiThemeProvider>
        </header>
        <Banner>
         <h1> Contact Us </h1>
        </Banner>
        <PleaseFill> Lets do business together! Send us a Message.

        </PleaseFill>
        <Fields>
        <MuiThemeProvider muiTheme={getMuiTheme()}>
        <TextField
        floatingLabelText="Please enter your full name"
        hintText = "Full Name"
        fullWidth={true}
        type = "text"
         />
        </ MuiThemeProvider>
         <br/>

         <MuiThemeProvider muiTheme={getMuiTheme()}>
         <TextField
        floatingLabelText="Please enter your contact number"
        hintText = "Number"
        fullWidth={true}
        type = "number"

         />
         </ MuiThemeProvider>
         <br/>
         <MuiThemeProvider muiTheme={getMuiTheme()}>
         <TextField
        floatingLabelText="Please enter your email id"
        hintText = "Email Id"
        fullWidth={true}


         />
         </ MuiThemeProvider>
         <br/>
         <MuiThemeProvider muiTheme={getMuiTheme()}>
         <TextField
        floatingLabelText="Enter your message"
        hintText = "Message Body"
        multiLine={true}
        rows ={5}
        fullWidth={true}

         />
         </ MuiThemeProvider>
         <br/>
         <br/>
         <br/>
         <Button>
         <MuiThemeProvider muiTheme={getMuiTheme()}>
        <RaisedButton label="Send" primary={true} style = {{ width: '16rem', height: '3.25rem',}} labelStyle = {labelStyle} />
        </ MuiThemeProvider>
        </Button>


        </ Fields>

        <ContactFooter>
            <Mapnew>
            <MapWithControlledZoom
    containerElement = {
        <div style = {{height: "100%", }} />
    }
    mapElement = {
        <div style = {{height: "100%"}} />

      }
          markers = {this.state.markers}

        />
            </ Mapnew>
            </ContactFooter>
          </ Wrapper>
        );
     }
   }

    export default Contact;

Yes I imported all the necessary things. Yes I have looked for all posible questions and answers on Stackoverflow.

Please let me know where I have gone wrong. Any help is appreciated.

Samkit Shah

This issue is resolved

The problem was that my header was overlaying the whole page. Everything was "behind" an invisible div, so when I click, I clicked the invisible div, instead of the text fields that lay behind.

These code in styled CSS div caused problems

Top: 0, bottom: 0

When I removed these lines, everything went back to normal.

Credit goes to Edo Rivai.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

React HOC working on some but not other components

RouterLink not working in child components

Jest snapshots not working with some Semantic-UI-React components

Tailwindcss not working in some of components in React / Next.js

onClick on "a" tag not working properly if it has some child elements in react

Adding child components in react

React styled components - target first-child and last-child not working

working with react components REACTjs

React: Child Components Without JSX

Dynamically add child components in React

Limit child components in a react component

React state in parent or child components

Codepen - react child components not rendering

Group specific child components React

Dynamically rendering child components in react

MapStateToProps and MapDispachToProps in parent and child components not working

Complex nested components on React not working

React native components not working properly

React: Pass function to a child not working

Enum React multiple different child components

Passing a React click handler to child components

Invoking child methods with Function Components and Hooks in React

React how to open child components with smooth rendering?

React - Wrapping Parent and Direct Child Components

Which is the way React unmounts child components?

Objects are not valid as a React child with Styled components

React useState passed as props is not changing in child components

React Native Navigation : Child components are not rendered on screen

React passing information to multiple child components