pnp / List-Formatting

List Formatting Samples for use in SharePoint and Microsoft Lists
https://pnp.github.io/List-Formatting/
MIT License
1.75k stars 844 forks source link

Disable Click Action - Still Opens Item #777

Closed influential-eliot closed 7 months ago

influential-eliot commented 7 months ago

Hi,

I believe that there may be a problem with the code in Disable default click action on a tile list view in the View Samples area.

This will only work if the options are as tiny as the code wants them to be, otherwise it still opens the item, often in a new tab.

A potential fix could be to alter line 20 (as I did) to:

{
  "action": "select"
}

I wouldn't say this is the 'fix', per se, but it works well enough for me right now in ensuring that nothing loads when tapping the button, but still allows the selection thereof.

I believe that the cause of this is the selector check box being the thing that we are focused upon.

tecchan1107 commented 7 months ago

Hi, @influential-eliot . Thank you for reporting this issue! I have removed the customRowAction and modified it so that clicking on an item does not display the list form! https://github.com/pnp/List-Formatting/tree/master/view-samples/disable-click-action

influential-eliot commented 7 months ago

Lovely stuff ... might've thrown folks for a loop, that!