From 717e8aa27e327cea839272fbf0bec7baa243e8bd Mon Sep 17 00:00:00 2001 From: David Sevilla Martin Date: Sun, 3 May 2020 10:42:25 -0400 Subject: [PATCH] common: fix Button children issue introduced in admin PR --- js/src/common/components/Button.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/src/common/components/Button.tsx b/js/src/common/components/Button.tsx index 38b8e95c9..056c8b72f 100644 --- a/js/src/common/components/Button.tsx +++ b/js/src/common/components/Button.tsx @@ -48,9 +48,8 @@ export interface ButtonProps extends ComponentProps { */ export default class Button extends Component { view() { - const attrs: T = { ...this.props }; - - const children = extract(attrs, 'children'); + const attrs = (({ children, ...o }) => o)(this.props) as T; + const children = this.props.children; attrs.className = attrs.className || ''; attrs.type = attrs.type || 'button'; @@ -63,7 +62,7 @@ export default class Button extends Compone // If nothing else is provided, we use the textual button content as tooltip if (!attrs.title && children) { - attrs.title = extractText(this.props.children); + attrs.title = extractText(children); } const iconName = extract(attrs, 'icon');