How to make an item in a grid unfocusable?

Hello,

I am using a grid to display content, and I would like to make items in the grid ‘unfocusable’ so that they cannot be focused on, as though they are locked. How is this possible to do? I can turn off any focus styling that I have, but that doesn’t take away the fact that the item is still selectable. Is there a way to disable the ability to focus in a grid but still have the item render?

Thanks.

Are you managing a the (selected) index yourself or using .next() and .previous() to change selected items in the grid?

You would need to store and manage your index and call (‘YourGrid’).setIndex(index) thereby skipping the index of any “disabled” items.

The grid is managing its own focus, .next() and other index methods are not being utilized as a result. So the only way to achieve this is by overriding the default grid behavior and managing it all myself?

Hey @myusername ,
Maybe you can listen onIndexChanged and add some logic to skip the “unfocusable” item.

1 Like