Fabric.js: object:selected event only firing on first selection

Created on 28 Nov 2017  路  3Comments  路  Source: fabricjs/fabric.js

Version

2.0.0-rc.3

Test Case

http://fabricjs.com/events

Steps to reproduce

Can be reproduced in event inspector - selected event only fired for first item selected on the canvas.

  • Select an object -> check events fired
  • Select another object -> check events fired

Expected Behavior

object:selected event will be fired each time an object is selected

Actual Behavior

object:selected only first for first selection - i.e. going from nothing selected to item selected.

Most helpful comment

OK - I've found the new event "selection:updated" that helps our use case for this event (tracking the active selection) but still seems odd that I can select an object and the event isn't fired consistently.

All 3 comments

OK - I've found the new event "selection:updated" that helps our use case for this event (tracking the active selection) but still seems odd that I can select an object and the event isn't fired consistently.

is fired differently.

please read the page:
http://fabricjs.com/v2-breaking-changes-2

object:selected is left just to do not make people rewrite lot of code, is deprecated and will be removed in next major version.

Ok thanks - I'd not seen that page - only breaking changes Part 1.

Was this page helpful?
0 / 5 - 0 ratings