Instead of providing alternate defaults for optgroupField,
optgroupLabelField, and optgroupValueField, respect the
selectize instance's settings for those fields.
Fixes#2192. Two problems here:
1. It's not documented but apparently we supported data frames for
choices in updateSelectInput/updateSelectizeInput (it doesn't
appear to work correctly for selectInput/selectizeInput though).
This was used in 023-optgroup-server as well as by the user who
reported #2172.
2. The example in 023-optgroup-server was also counting on the
default value of optgroupLabelField, which (starting post-Shiny
v1.1) was being set to a new default of "group". That now won't
happen unless optgroupField is also blank. I'm less confident
about the ramifications of this change. The selectize docs with
the relevant bits are here:
https://github.com/selectize/selectize.js/blob/master/docs/usage.md#data_searching
This bug is new since v1.1. When results are returned from selectize's
server-side endpoint, iff no results have been selected before, then
the control should be set to either its specified initial value (the
one specified in selectInput/selectizeInput) or, if none was provided
AND the selectize control is multiple=FALSE, then select the first
entry automatically.
That's the desired behavior; the bug was that last part, "select the
first entry automatically", was happening whether results had already
been selected before or not. This was causing merely typing in the
control to cause the value to be changed.
Fixes#2191
Previously I was using a hack to set the selected value of selectize, i.e. add the selected option(s) to selectize via addOptions() (because the selected option(s) may not have existed); this hack can be removed and we can set the value in the `success` callback of the Ajax request, by which time the options will be available