Skip to content

Commit

Permalink
fix(Button): allow user set heights to superceeds fallback style height
Browse files Browse the repository at this point in the history
  • Loading branch information
erautenberg committed Nov 6, 2023
1 parent c1d70e3 commit fc58668
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ export default class Button extends Surface {
this._Content.patch(this._contentProps);
}

set h(v) {
super.h = v;
}

get h() {
return super.h || this.style.textStyle.lineHeight + this.style.paddingY * 2;
}

_updateSurfaceDimensions() {
let newWidth = this.w;
if (this.fixed) {
Expand All @@ -261,10 +269,6 @@ export default class Button extends Surface {
this.w = newWidth;
}

this.h =
this.style.height ||
this.style.textStyle.lineHeight + this.style.paddingY * 2;

// TODO breaks row resizing if this is wrapped in the above conditional
this.fireAncestors('$itemChanged');
}
Expand Down

0 comments on commit fc58668

Please sign in to comment.