magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

Fixed row click issue in product's upsell/crosssell/related grids

Open addison74 opened this issue 1 year ago • 7 comments

When you add/remove/set position in the Related Products / Up-sells / Cross-sells grids, you may face an important issue without realizing it. As the grid functionality was thought by the Magento team, when you click on a row, regardless of the position where the mouse pointer is, the row will be checked or unchecked. As soon as you press any of the [Save] buttons, products may appear or disappear in the grid by mistake. I faced this issue many times when I was editing the position and I didn't click exactly in the box but a little next to it.

related

This PR solves the issue and limits the row click strictly to the grid cell where the checkbox is (the first column). Unlike the Products grid, where the box must be checked strictly in the square, otherwise the product editing page is loaded, this modification is more permissive and the click can be in the entire cell where the box is located (td element).

addison74 avatar Mar 03 '24 19:03 addison74

@fballiano - I created this PR directly in Github. There are two commits coming from a previous PR. Please fix this issue for me. Thank you.

addison74 avatar Mar 03 '24 19:03 addison74

For this one

/js/mage/adminhtml/grid.js

addison74 avatar Mar 03 '24 19:03 addison74

this should be ok

fballiano avatar Mar 03 '24 19:03 fballiano

Many thanks. This one is ready for testing.

addison74 avatar Mar 03 '24 20:03 addison74

Thank you for this one!

andrewcbi avatar Mar 04 '24 08:03 andrewcbi

question, since this PR modifies js/mage/adminhtml/grid.js, isn't it affecting all grids in all backend?

fballiano avatar Mar 04 '24 09:03 fballiano

I have checked all the grids in the Backend and the change in this PR affects only the grids that do not have an associated action on a row. Let's take a few examples.

For the products grid in Catalog > Manage Products, when you bring the mouse pointer on a row, it becomes a hand. There is an link for the editing action. All grids that have an action column have the same behavior.

For the subscribers grid in Newsletter > Newsletter Subscriber, the selection is made only on the first column where the checkbox is and not on the whole row as it was until now.

TODO 1: Checking the grids that have actions associated on a row, I noticed a problem that will have to be fixed in another PR. Check/Uncheck on the first column is done only in the checkbox square, if you click a little outside, the page specific to the action is loaded. Selecting a row must be done in the entire cell, not just in the checkbox square only.

TODO 2: For grids that do not have action on a row such as Related Products / Up-sells / Cross-sells / Newsletter Subscribers, the mouse pointer must remain the arrow and not the hand that symbolizes that there is a link. This problem must be fixed in another PR too.

addison74 avatar Mar 04 '24 21:03 addison74