'Fabric.js disable object selection but enable target find?

I want to let all fabric canvas objects could be detected on mouse move, but cannot be click or select.

if (isHoverMode == true) {
  canvas.selection = false
  canvas.skipTargetFind = true  // <-this cause object could be selectable!
  canvas.on('mouse:over', function(e) {
      // do something on e.target ...
  });
}

It turns out that canvas.skipTargetFind must set to true in order to have mouse:over event to work. But then the objects could also be selected.

How could I prevent object to be selectable?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source