-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Switches not responding to clicks #3951
Comments
I am also using the Checkbox in a Meteor 1.3.1 app and by coincidence stumbled upon the same problem. Turns out that when you use <Checkbox
label="Complete?"
defaultChecked={item.complete}
ref="complete"
onCheck={(e, checked) => this.markComplete(checked)}
/> In my case I wasn't using states btw. So markComplete() {
const complete = this.refs.complete.isChecked();
const itemId = this.props.item._id;
Meteor.call('items.markComplete', complete, itemId);
} |
I also tried |
Even if you use the code I provided? |
Sorry. It doesn't work. |
I am currently having a similar issue. Attempting to use the RadioButtonGroup, ran down the rabbit hole for a while only, only to finally abandon using this item, (maybe even adding react and material ui to that list). I really think this is related to where this is placed: // Needed for onTouchTap I tried to move it around as well, but based on prior experience with getting simple dropdown's and sidebar toggle working, I think it might be possible the click in this instance is not being triggered. Best of luck, I'll let you know if anything changes on my end :) |
I just had the same problem and after some deeper investigation I found the switch elements being highly reliable on an invisible Some of my css that I received from a designer contained something like:
No idea why the designer put that there, probably to hide it in certain restyled use-cases. After removing that part, all material-ui switches started working perfectly! |
This is probably related to #2983. |
I don't see how it is directly related to that issue. From the explanation in my reply here and on the other issue, it can be deduced that these are most likely two separate issues. Also in this issue the checkbox does not even respond at all, while in the other issue it responds but gets a reset. |
this is actually a easy issue. If you ever use this._toggleCheck = (evt, isInputChecked) => {
evt.preventDefault();
setTimeout( () => this.setState({
check: !this.state.check
}));
}; |
Can this be closed by @Evilcat325 's solution? @jschlieber |
No, because (as I stated in the problem description) in my case the |
The problem persists, but I figured it's probably a conflict with the MaterializeCSS library, which is also used in this particular project. Unfortunately I didn't have the time to check and to create a repro. I won't have time before september as I am working on a different project right now. Thanks for your help. |
Problem Description
I'm using material-ui in a Meteor 1.3.1 application via npm. So far, all components I've used (Dialoges, Tabs, Icons, GridLists, Selects, TextFields, Popovers, Menus, Lists, Snackbars, Buttons, LeftNav) work like a charm. But a simple plain Checkbox does not respond to any clicks. It doesn't matter whether controlled or uncontrolled. It doesn't matter where i put it. It simply does not respond to any user interaction. The onCheck function never gets called. I can control the Checkbox with a button thought. For example, here I can check and uncheck the Checkbox by clicking on the FlatButton, but none of the other components (including the CheckBox itself) respond to clicks:
I'm lost here. Am I missing something? Any help would be much appreciated. Thanks!
Versions
The text was updated successfully, but these errors were encountered: