- var c = f.ownerCt, l,
- ps = f.previousSibling(),
- ns = f.nextSibling();
- if (Ext.isEmpty(n)) {
- if (!Ext.isEmpty(o)) {
-// The Field has been blanked, and it is not the only one left, remove it
- if ((ps && (ps.replicator === this)) || (ns && (ns.replicator === this))) {
- l = f.findParentBy(function(p) {
- return !Ext.isDefined(p.ownerCt);
- });
- c.remove(f);
- l.doLayout();
- }
- }
- } else {
- if (Ext.isEmpty(o)) {
-// Field filled, insert a clone as the next sibling
- ns = new f.constructor(f.cloneConfig());
- c.insert(c.items.indexOf(f) + 1, ns);
- c.doLayout();
- l = f.findParentBy(function(p) {
- return !Ext.isDefined(p.ownerCt);
- });
- l.doLayout();
- }
+ // If a field before the final one was blanked out, remove it
+ if (isEmpty && !isLastInGroup) {
+ Ext.Function.defer(field.destroy, 10, field); //delay to allow tab key to move focus first