<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: uyarahmet</title>
    <description>The latest articles on DEV Community by uyarahmet (@uyarahmet).</description>
    <link>https://dev.to/uyarahmet</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F671526%2Fd153fbdc-3a86-4728-a4ee-66486cdc7bed.jpeg</url>
      <title>DEV Community: uyarahmet</title>
      <link>https://dev.to/uyarahmet</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/uyarahmet"/>
    <language>en</language>
    <item>
      <title>Google maps disables button and input fields</title>
      <dc:creator>uyarahmet</dc:creator>
      <pubDate>Wed, 21 Jul 2021 14:07:50 +0000</pubDate>
      <link>https://dev.to/uyarahmet/google-maps-disables-button-and-input-fields-5h6b</link>
      <guid>https://dev.to/uyarahmet/google-maps-disables-button-and-input-fields-5h6b</guid>
      <description>&lt;p&gt;My semantic-ui-react Menu component is acting strange when I add my google maps component to be rendered. Before I added my MapContainer, the FilterSection was working pretty fine. But after I render the MapContainer my sections in my Menu are no longer clickable nor do they react to my mouse hover. What should I do?&lt;/p&gt;

&lt;p&gt;Snippet of render:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Navbar/&amp;gt;
      &amp;lt;FilterSection/&amp;gt;
      &amp;lt;ChatWidget/&amp;gt;
      &amp;lt;div className="map-and-cards"&amp;gt;
        &amp;lt;MapContainer/&amp;gt; // This line causes the problem
        &amp;lt;div style={containerStyle} className="cards-container"&amp;gt;
          &amp;lt;div class="card-columns" style={{gridTemplateColumns: '350px 350px', display: 'grid', rowGap: '50px', columnGap: '18px'}}&amp;gt;
            &amp;lt;Cards listingData={listingData}/&amp;gt;
          &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and my MapContainer.js:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import { Map, GoogleApiWrapper } from 'google-maps-react';

const style = {
  position: 'relative',
  top: '65px',
  width: '47.5%', // 47.5
  height: '85%',
};


const defaultCenter = {
  lat: 41.04137, lng: 28.979530
}

export class MapContainer extends React.Component&amp;lt;MapProps&amp;gt; {

 render() {
  return (
    &amp;lt;Map
        style = {style}
        google={this.props.google}
        centerAroundCurrentLocation={true}
        zoom={12}
        initialCenter={defaultCenter}
    /&amp;gt;
  );
 }
}

export default GoogleApiWrapper({
  apiKey: (0)
})(MapContainer) 

FilterSection.js:


import React, { Component } from "react";
import { Menu, Dropdown, Input, Button } from "semantic-ui-react";
import 'semantic-ui-css/semantic.min.css'

export class Price extends Component {
  state = { isOpen: false };

  handleItemClick = (e, { name }) =&amp;gt; this.setState({ activeItem: name });

  render() {
    const { activeItem } = this.state;

    return (
    &amp;lt;div style={{float: 'left'}}&amp;gt;
      &amp;lt;Menu secondary &amp;gt;
       &amp;lt;Menu.Item&amp;gt;
        &amp;lt;Dropdown
          text={"Price"}
          className="item"
          onClick={this.toggleOpen}
          open={this.state.isOpen}
        &amp;gt;
          &amp;lt;Dropdown.Menu onClick={this.preventClosing}&amp;gt;
            &amp;lt;Dropdown.Header icon="money" content={" Price Range"} /&amp;gt;
            &amp;lt;Dropdown.Divider /&amp;gt;
            &amp;lt;form
              style = {{margin: '10px'}}
              name="id"
              type="number"
              max={900}
              action={&amp;lt;Button onClick={this.toggleOpen} content={"Send"} /&amp;gt;}
            &amp;gt;
            &amp;lt;Input style={{zoom: '0.9'}} placeholder="min"/&amp;gt;&amp;amp;nbsp;—&amp;amp;nbsp;&amp;lt;Input style={{zoom: '0.9'}} placeholder="max"/&amp;gt;
            &amp;lt;/form&amp;gt;
          &amp;lt;/Dropdown.Menu&amp;gt;
        &amp;lt;/Dropdown&amp;gt;
        &amp;lt;/Menu.Item&amp;gt;
       &amp;lt;/Menu&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }

  toggleOpen = () =&amp;gt; this.setState({ isOpen: !this.state.isOpen });
  preventClosing = e =&amp;gt; e.stopPropagation();
}

export class BedsAndBaths extends Component {
  state = { isOpen: false };

  handleItemClick = (e, { name }) =&amp;gt; this.setState({ activeItem: name });

  render() {
    const { activeItem } = this.state;

    return (
    &amp;lt;div style={{float: 'left'}}&amp;gt;
      &amp;lt;Menu secondary&amp;gt;
       &amp;lt;Menu.Item&amp;gt;
        &amp;lt;Dropdown
          text={"Bedrooms &amp;amp; Livingrooms"}
          className="item"
          onClick={this.toggleOpen}
          open={this.state.isOpen}
        &amp;gt;
          &amp;lt;Dropdown.Menu onClick={this.preventClosing}&amp;gt;
            &amp;lt;form
              style = {{margin: '10px'}}
              name="id"
              type="number"
              max={900}
              action={&amp;lt;Button onClick={this.toggleOpen} content={"Send"} /&amp;gt;}
            &amp;gt;
            &amp;lt;Input style={{zoom: '0.9'}} placeholder="3"/&amp;gt;&amp;amp;nbsp;+&amp;amp;nbsp;&amp;lt;Input style={{zoom: '0.9'}} placeholder="1"/&amp;gt;
            &amp;lt;/form&amp;gt;
          &amp;lt;/Dropdown.Menu&amp;gt;
        &amp;lt;/Dropdown&amp;gt;
        &amp;lt;/Menu.Item&amp;gt;
       &amp;lt;/Menu&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }

  toggleOpen = () =&amp;gt; this.setState({ isOpen: !this.state.isOpen });
  preventClosing = e =&amp;gt; e.stopPropagation();
}

export class More extends Component {
  state = { isOpen: false };

  handleItemClick = (e, { name }) =&amp;gt; this.setState({ activeItem: name });

  render() {
    const { activeItem } = this.state;

    return (
    &amp;lt;div style={{float: 'left'}}&amp;gt;
      &amp;lt;Menu secondary&amp;gt;
       &amp;lt;Menu.Item&amp;gt;
        &amp;lt;Dropdown
          text={"More"}
          className="item"
          onClick={this.toggleOpen}
          open={this.state.isOpen}
        &amp;gt;
          &amp;lt;Dropdown.Menu onClick={this.preventClosing}&amp;gt;
            &amp;lt;Dropdown.Header icon="money" content={" Price Range"} /&amp;gt;
            &amp;lt;Dropdown.Divider /&amp;gt;
            &amp;lt;form
              style = {{margin: '10px'}}
              name="id"
              type="number"
              max={900}
              action={&amp;lt;Button onClick={this.toggleOpen} content={"Send"} /&amp;gt;}
            &amp;gt;
            &amp;lt;Input style={{zoom: '0.9'}} placeholder="min"/&amp;gt;&amp;amp;nbsp;—&amp;amp;nbsp;&amp;lt;Input style={{zoom: '0.9'}} placeholder="max"/&amp;gt;
            &amp;lt;/form&amp;gt;
          &amp;lt;/Dropdown.Menu&amp;gt;
        &amp;lt;/Dropdown&amp;gt;
        &amp;lt;/Menu.Item&amp;gt;
       &amp;lt;/Menu&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }

  toggleOpen = () =&amp;gt; this.setState({ isOpen: !this.state.isOpen });
  preventClosing = e =&amp;gt; e.stopPropagation();
}

export class Alert extends Component {
  state = { isOpen: false };

  handleItemClick = (e, { name }) =&amp;gt; this.setState({ activeItem: name });

  render() {
    const { activeItem } = this.state;

    return (
    &amp;lt;div style={{float: 'left', position: 'relative', top: '11.5px', left: '15px', zoom: '0.9'}}&amp;gt;
      &amp;lt;Menu secondary &amp;gt;
      &amp;lt;button class="ui button "&amp;gt;
        Create Alert
      &amp;lt;/button&amp;gt;
       &amp;lt;/Menu&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }

  toggleOpen = () =&amp;gt; this.setState({ isOpen: !this.state.isOpen });
  preventClosing = e =&amp;gt; e.stopPropagation();
}

export class Search extends Component {
  state = { isOpen: false };

  handleItemClick = (e, { name }) =&amp;gt; this.setState({ activeItem: name });

  render() {
    const { activeItem } = this.state;

    return (
    &amp;lt;div style={{float: 'left', position: 'relative', top: '12px', right: '50px', zoom: '0.9'}}&amp;gt;
        &amp;lt;Menu secondary &amp;gt;
        &amp;lt;div style={{float: 'left', position: 'relative', right: '10px'}} class="ui input focus"&amp;gt;
          &amp;lt;input type="text" placeholder="Enter an adress, neigborhood, city, or ZIP code
" size="45"/&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;button class="ui button "&amp;gt;
          Search
        &amp;lt;/button&amp;gt;
       &amp;lt;/Menu&amp;gt;
      &amp;lt;/div&amp;gt;
    );
  }

  toggleOpen = () =&amp;gt; this.setState({ isOpen: !this.state.isOpen });
  preventClosing = e =&amp;gt; e.stopPropagation();
}


export default function FilterSection(){
  return (
    &amp;lt;div style={{position: 'relative', left: '75px', bottom: '1px'}}&amp;gt;&amp;lt;Search/&amp;gt;&amp;lt;div style={{position: 'relative', right: '30px'}}&amp;gt;&amp;lt;More/&amp;gt;&amp;lt;BedsAndBaths/&amp;gt;&amp;lt;Price/&amp;gt;&amp;lt;Alert/&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;
  )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As I said, only the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
 component is triggering the deactivation of the menu.

You can see the actual page at royaremlak.com/search
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>react</category>
    </item>
  </channel>
</rss>
