I'm working on a react project where there will be a react material ui table component. Inside the table(10 reacords/rows in each page), the last element in every row is a
Material UI MoreVert Icon
Expected Behaviour: When I click on the MoreVert icon in first row, it should show me the menu of options and when I click elsewhere the menu should be closed.
Current Behaviour: When I click the MoreVert Icon in the first row(or any of the rows in the page), it is showing me the options but when I click elsewhere in the page, the menu displayed on the current row is closing and at the same time a click event is automatically happening on the MoreVert icon in the 10th row(last row of the page) and the menu is opening for the 10th row.
Can anyone help me in achieving the expected behaviour
I'm working on a react project where there will be a react material ui table component. Inside the table(10 reacords/rows in each page), the last element in every row is a Material UI MoreVert Icon
Expected Behaviour: When I click on the MoreVert icon in first row, it should show me the menu of options and when I click elsewhere the menu should be closed.
Current Behaviour: When I click the MoreVert Icon in the first row(or any of the rows in the page), it is showing me the options but when I click elsewhere in the page, the menu displayed on the current row is closing and at the same time a click event is automatically happening on the MoreVert icon in the 10th row(last row of the page) and the menu is opening for the 10th row.
Can anyone help me in achieving the expected behaviour
My code:
My code for menu options