Angular-gridster2: Resizable stop even hook get's old data

Created on 9 Jan 2018  路  4Comments  路  Source: tiberiuzuld/angular-gridster2

Explanation

On resizable.stop event callback we receive GridsterItem as a first argument, however data is outdated.
Is that perhaps by design?

Steps to reproduce

  1. Assign callback to resizable.stop
  2. Resize any GridsterItem
    2.1. First argument in assigned callback is instance of GridsterItem
  3. Observe resized dimension(s) and notice, that old values are provided
enhancement question

All 4 comments

Hi @klemenoslaj ,
Second argument gridsterItem.$item has the new values.
The first argument still has the old values because in stop you can cancel the resize.

Hi @tiberiuzuld,

thanks for the quick answer.
I could have looked a little bit better and saw that GridsterItemComponent indeed have public item :( sorry.

Maybe small suggestion then:
Does it makes sense to add more strict function types to GridBase in gridsterConfig.interface.d.ts?

e.g. start?(item: GridsterItem, itemComponent: GridsterItemComponent, event: MouseEvent): void;

Hmm yes maybe should add the parameters to functions.

Will do.

Thanks

Added in 4.4.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jayoma picture jayoma  路  3Comments

JohnxAss picture JohnxAss  路  5Comments

matpag picture matpag  路  3Comments

dhaniksahni picture dhaniksahni  路  4Comments

tiberiuzuld picture tiberiuzuld  路  3Comments