Skip to content

Commit

Permalink
Callout, FormItem: better content resize handling
Browse files Browse the repository at this point in the history
  • Loading branch information
joshtynjala committed May 21, 2024
1 parent c900e49 commit 80ddd02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/feathers/controls/Callout.hx
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ class Callout extends FeathersControl {
}
this._content = value;
if (this._content != null) {
this._content.addEventListener(Event.RESIZE, callout_content_resizeHandler, false, 0, true);
this.addChild(this._content);
if ((this._content is IUIControl)) {
(cast this._content : IUIControl).initializeNow();
Expand All @@ -334,6 +333,7 @@ class Callout extends FeathersControl {
} else {
this._contentMeasurements.save(this._content);
}
this._content.addEventListener(Event.RESIZE, callout_content_resizeHandler, false, 0, true);
}
this.setInvalid(DATA);
this.setInvalid(SIZE);
Expand Down
6 changes: 5 additions & 1 deletion src/feathers/controls/FormItem.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,11 @@ class FormItem extends FeathersControl implements ITextControl implements IFocus
if (this._ignoreContentResize) {
return;
}
this._contentMeasurements.save(this.content);
if (this._contentMeasurements == null) {
this._contentMeasurements = new Measurements(this._currentContent);
} else {
this._contentMeasurements.save(this._currentContent);
}
this.setInvalid(SIZE);
}
}

0 comments on commit 80ddd02

Please sign in to comment.