mirror of
https://github.com/flarum/framework.git
synced 2025-05-22 22:59:57 +08:00
Fix admin navigation not rendering
Not sure why this started happening now, but the admin navigation dropdown wasn't receiving its children properly. This commit fixes a flaw in our Mithril patch and allows an array of children to be passed in the normal JSX way, rather than as an attribute.
This commit is contained in:
@ -18,9 +18,9 @@ export default class AdminNav extends Component {
|
|||||||
return (
|
return (
|
||||||
<SelectDropdown
|
<SelectDropdown
|
||||||
className="AdminNav App-titleControl"
|
className="AdminNav App-titleControl"
|
||||||
buttonClassName="Button"
|
buttonClassName="Button">
|
||||||
children={this.items().toArray()}
|
{this.items().toArray()}
|
||||||
/>
|
</SelectDropdown>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,12 @@ export default function patchMithril(global) {
|
|||||||
|
|
||||||
const m = function(comp, ...args) {
|
const m = function(comp, ...args) {
|
||||||
if (comp.prototype && comp.prototype instanceof Component) {
|
if (comp.prototype && comp.prototype instanceof Component) {
|
||||||
return comp.component(args[0], args.slice(1));
|
let children = args.slice(1);
|
||||||
|
if (children.length === 1 && Array.isArray(children[0])) {
|
||||||
|
children = children[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
return comp.component(args[0], children);
|
||||||
}
|
}
|
||||||
|
|
||||||
const node = mo.apply(this, arguments);
|
const node = mo.apply(this, arguments);
|
||||||
|
Reference in New Issue
Block a user