To perform position checking for an attached elements we have added this code.
We are storing the lastItem and passing this lastItem value to onContentChanged function for executing the resizing operation only one time.