-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Custom Dropdown menuOnClick now working #44
Comments
Hello @vepak , Thank you for your interest in working with our product.
Also, could you tell me where did you find the Best, |
I tried onClick as well, it didn't work. <CustomDropdown Regarding menuOnClick, with V1 of material-kit-react, onClick didn't work so I tried menuOnClick and it worked for me. I've been using it ever since and when I upgraded to V2, it started breaking. It's an accidental discovery :) |
Hello again @vepak , Can you try this code:
Or this one:
Best, |
Hi Manu, Thank you for your time. I tried all the possible ways with onClick. But nothing worked. Could you please kindly try to use CustomDropdown and see if it's working for you. As in the examples and documentation, there is no clear example of how to use onClick and nothing seem to work in the following as well if there is a change in value for drop down https://demos.creative-tim.com/material-dashboard-react/#/documentation/dropdown Once again really appreciate your time. Thanks, |
Hello again @vepak , Sorry for not looking a bit more into this problem.
And after that, for example you will need the following code to access them:
I hope this information helps you, and once again, sorry for not looking more into this, I was convinced that the issue was solved in the last update. Best, |
Thank you, Manu. It worked I think the line numbers should be?
-Vamsi. |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
When Value is changed on dropdown menuOnClick method is not firing
Current Behavior
What is the current behavior?
Steps to Reproduce
<CustomDropdown
id="purpose"
name="purpose"
buttonText={selectedPurposeIndex!==null ? Purposes[selectedPurposeIndex] : 'Select Purpose of the request'}
dropdownHeader="Select Purpose of the request"
menuOnClick={handlePurposeChange}
buttonProps={{
color: "info",
fullWidth: true
}}
dropdownList={Purposes}
/>
handlePurposeChange is passed as props
handlePurposeChange = (event, index) => {
console.log(index)
this.setState({
selectedPurposeIndex: index,
dropPurpose: Purposes[index]
})
};
The text was updated successfully, but these errors were encountered: