appsmith
appsmith copied to clipboard
[Bug]: Event gets triggered even when option is not changed
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
In a TreeSelect widget, on configuring an event for the onOptionChange
property we see that the said event gets triggered even when we do not change the selected option.
Steps To Reproduce
- D&D a TreeSelect widget.
- Configure the
onOptionChange
event in such a way that we get to see an alert once we change the selected option. - Now open the dropdown of the widget & click on the already selected option.
Expected: The onOptionChange
event should not get triggered as we did not change the option.
Actual: The event gets triggered.
Public Sample App
No response
Environment
Production
Issue video log
https://www.loom.com/share/48d0980974e646e9b08af14840755430
Version
Cloud
@somangshu can i work on this?
@shadabbuchh can i work on this???
Greetings @skmanoj322, thanks for showing interest 🎉 , This is all your. Assigning this to you now.
Please don't forget to read the Contribution Guidelines. Would appreciate if you can open a PR within the next 2 days. Please let me know here so that I can take it forward for a review
Ok I will start working on this problem and open a pr as soon as possible
@shadabbuchh it is getting triggered because we are having Click event on the select. for the same Item if you don't want to get triggered then you have to use condition there. Hope it works for you.
So probably you have to make onChange handler instead of Onclick
<select onChange={(event)=>alert(event.target.value)} >
</select>
@Chandan9898Kumar will you be interested in picking this up?
@dilippitchika
I love to work on this ticket, please give me some time to set my repository.
@Chandan9898Kumar thanks for showing the interest. Ill keep this issue assigned to you, please let us know here if you raise a PR fixing the issue.
ya difficulties i faced is running docker and my pc didnt supported it
ya difficulties i faced is running docker and my pc didnt supported it
@skmanoj322 I understand that you are keen to work on this ticket, if you have resolved your docker issue then you can connect with @somangshu before i start working on this ticket.
No go ahead if find success kindly share
@somangshu The onOptionChange event should not get triggered until the value is changed for all the options right?
I think we can just compare the previous and changed value, if its same we dont need to trigger onoptionchange event.
Please let me know if this sounds good I will raise a PR for this.
@harshitpandey0426 go ahead if @somangshu agree with you, even currently I'm facing issues on setting my repo.
@harshitpandey0426 yes that is correct, i am assigning this to you. Please feel free to raise a PR in the next 2 days.
@Chandan9898Kumar @skmanoj322 please let us know what are the challenges faced by you in setting up the instance, we will try to support so that you can work on other issues.
@dilippitchika running the docker in local machine is stressing my pc
@dilippitchika @somangshu Raised PR please have a look
Thanks let us check, @vsvamsi1 can you review this as well?
Recording for the test performed after change
https://www.loom.com/share/008d87273b50441f9f56d8f5eef1ed73