Select in Query Editor how to execute a query with the default value

Hello,
This is my query editor :

<div className="gf-form">
                <Select
                    placeholder="Select a Channel"
                    options={ListChannel}
                    showAllSelectedWhenOpen={true}
                    defaultValue={ListChannel[0]}
                    onChange={function (value: SelectableValue<string>): void | {} {
                        valuechannel = value
                        onRunQuery()
                    }} />
            </div>

But on the first load of my page, there isn’t data i’m forced to select one in my list and then it’s works.
How to make my default value work in the first load ?

Nicolas

Hi @nicolasdossantos248 have you tried setting a value attribute in the Select component?

you can see examples of the select component here Webpack App

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.