Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[List] Fix clicking "Toggle Nested Items" icon triggering left checkbox toggle #7171

Merged
merged 1 commit into from
Jul 8, 2017

Conversation

hwo411
Copy link

@hwo411 hwo411 commented Jun 18, 2017

  • IOS safari is affected (tested on iPad Mini 2i & iOS 10.3.2)
  • Can't reproduce on Android/Windows mobile/desktop browsers

So the issue appears to be only under iOS safari.

The simple code snippet to reproduce:

import React from 'react'
import ReactDOM from 'react-dom'
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'
import { List, ListItem } from 'material-ui/List'
import Checkbox from 'material-ui/Checkbox'
import injectTapEventPlugin from 'react-tap-event-plugin';

function onload() {
  injectTapEventPlugin();
  ReactDOM.render(
    (
      <MuiThemeProvider>
        <List>
          <ListItem primaryText="root" leftCheckbox={<Checkbox/>} nestedItems={
            [
              <ListItem primaryText="child1" />,
              <ListItem primaryText="child2" />
            ]
          } />
        </List>
      </MuiThemeProvider>
    ),
    document.body
  )
}

document.addEventListener('DOMContentLoaded', onload, false);

It might be injectTapEventPlugin or browser issue, but the result is that component doesn't work correctly and adding preventDefault seems to fix it.

Screenshots:
Win10/Chrome
no-bug1
no-bug2

Android/Chrome
no-bug3
no-bug4

iOS/Safari
bug-1
bug-2

…ox toggle.

* IOS safari is affected (tested on iPad Mini 2i & iOS 10.3.2)
* Can't reproduce on Android/Windows mobile/desktop browsers
@mbrookes mbrookes added bug 🐛 Something doesn't work component: list This is the name of the generic UI component, not the React module! PR: Review Accepted labels Jun 26, 2017
@oliviertassinari oliviertassinari merged commit f075239 into mui:master Jul 8, 2017
@oliviertassinari
Copy link
Member

@hwo411 Thanks

djbuckley added a commit to manchesergit/material-ui that referenced this pull request Jul 10, 2017
* call_em_all_-_master/master:
  [List] Fix clicking "Toggle Nested Items" icon triggering left checkbox toggle. (mui#7171)
  Document: Update CONTRIBUTING.md with v1-alpha branch (mui#7371)
  Document: Update ROADMAP.md with v1-alpha branch (mui#7345)
@oliviertassinari oliviertassinari changed the title [List] Fix clicking "Toggle Nested Items" icon triggering left checkbox toggle. [List] Fix clicking "Toggle Nested Items" icon triggering left checkbox toggle Jul 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: list This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants