mirror of
https://github.com/flarum/core.git
synced 2025-08-05 16:07:34 +02:00
Replace get first element from filter with find
This commit is contained in:
committed by
Franz Liedke
parent
0e715a8c40
commit
537e2690e8
@@ -39,7 +39,7 @@ export default class SelectDropdown extends Dropdown {
|
||||
}
|
||||
|
||||
getButtonContent(children) {
|
||||
const activeChild = children.filter(isActive)[0];
|
||||
const activeChild = children.find(isActive);
|
||||
let label = (activeChild && activeChild.children) || this.attrs.defaultLabel;
|
||||
|
||||
if (label instanceof Array) label = label[0];
|
||||
|
Reference in New Issue
Block a user