It's "aggro" is not reset. They will continue to attack enemy CC troops (or trap skels) until there's no more "near" them. With "near" being defined as less than 10 tiles away (maybe even longer).
See here:
http://imgur.com/wDF0pG6,UxyfQku,AU9...N3I8ed,WQvSKwW
First some archers which were attacking a dragon and the circled group of dragons aggro'd them. As expected.
Then the same group aggro'd some mages which were quite some distance away, ignoring the nearby AD and WT.
Once the last wiz was killed then they aggro'd the barbs which just had poped out of CC.
In the case of the wiz it was understandable because the wiz was attacking another dragon. But those barbarians didn't have the chance to attack anything, yet the dragons started chasing them, ignoring the AD, WT, Castle, Tesla, TH, etc. Only once the last barbarian was killed did the dragons bother targetting the nearest building (the TH).