mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 16:47:42 +08:00
common: fix Button children issue introduced in admin PR
This commit is contained in:
parent
8b4046fdd4
commit
717e8aa27e
@ -48,9 +48,8 @@ export interface ButtonProps extends ComponentProps {
|
||||
*/
|
||||
export default class Button<T extends ButtonProps = ButtonProps> extends Component<T> {
|
||||
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<T extends ButtonProps = ButtonProps> 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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user