From bdf2573db99d3a7fc4c918b2aeff0c01c33e11da Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Tue, 18 Dec 2018 14:30:46 +0100 Subject: [PATCH] fix condition that expands group if it has a selected child. also make it possible to pass expanded as a prop --- public/app/core/components/Select/OptionGroup.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/app/core/components/Select/OptionGroup.tsx b/public/app/core/components/Select/OptionGroup.tsx index a001f58c681..2e955579ed4 100644 --- a/public/app/core/components/Select/OptionGroup.tsx +++ b/public/app/core/components/Select/OptionGroup.tsx @@ -2,7 +2,11 @@ import React, { PureComponent } from 'react'; import { GroupProps } from 'react-select/lib/components/Group'; interface ExtendedGroupProps extends GroupProps { - data: any; + data: { + label: string; + expanded: boolean; + options: any[]; + }; } interface State { @@ -15,8 +19,10 @@ export default class OptionGroup extends PureComponent option.value === value)) { this.setState({ expanded: true });