material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[Menu] Input fields not selectable on iPhone Chrome

Open valentinvichnal opened this issue 10 years ago • 3 comments

Problem Description

On a small site I imported material-ui, there are some simple html input tags, when I place this simple code to anywhere:

<Menu >
  <MenuItem  />
</Menu>

This makes any input fields not selectable, even so when the input is not related to the menu code, both can be on the body, or nth children of different divs. When I tap any input field, the mobile device's keyboard pops out then right after it hides the keyboard and unfocus the input field.

The problem only comes up on iPhone Chrome, it works on the iPhone Safari and on Desktop Chrome (no bugs using any device mode on desktop).

Versions

  • Material-UI: 0.15.0-alpha.2
  • React: 15
  • Browser: iPhone 5 Chrome (iPhone Safari works)

valentinvichnal avatar Apr 13 '16 23:04 valentinvichnal

@valentinvichnal what version of chrome on iphone?

nathanmarks avatar Apr 14 '16 12:04 nathanmarks

@nathanmarks Sorry I forgot to write, 49.0.2623.109

valentinvichnal avatar Apr 14 '16 12:04 valentinvichnal

Found the problem, this small code was the cause of this:

  componentDidMount() {
    window.addEventListener('resize', this.handleResize);
    this.handleResize();
  }
  handleResize() {
    const windowWidth = window.innerWidth;
    this.setState({windowWidth});
  }

Mobile Chrome may resize the window width when displays the keyboard, this event handler interrupts it somehow. But I don't get it how it is related to the MenuItem component...

valentinvichnal avatar Apr 14 '16 14:04 valentinvichnal