Skip to content

Commit bd69be7

Browse files
committed
Fix multivalued messages
1 parent e5eaa5c commit bd69be7

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

src/components/fields/MarkerColor.js

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,30 @@ class UnconnectedMarkerColor extends Component {
166166

167167
renderVariableControls() {
168168
const _ = this.context.localize;
169+
const multiValued =
170+
(this.props.container &&
171+
this.props.container.marker &&
172+
(this.props.container.marker.colorscale &&
173+
this.props.container.marker.colorscale === MULTI_VALUED)) ||
174+
(this.props.container.marker.colorsrc &&
175+
this.props.container.marker.colorsrc === MULTI_VALUED);
169176
return (
170-
<Fragment>
177+
<Field multiValued={multiValued}>
171178
<DataSelector
179+
suppressMultiValuedMessage
172180
attr="marker.color"
173181
placeholder={_('Select a Data Option')}
174182
/>
175183
{this.props.container.marker &&
176184
this.props.container.marker.colorscale === MULTI_VALUED ? null : (
177185
<Colorscale
186+
suppressMultiValuedMessage
178187
attr="marker.colorscale"
179188
updatePlot={this.setColorScale}
180189
colorscale={this.state.colorscale}
181190
/>
182191
)}
183-
</Fragment>
192+
</Field>
184193
);
185194
}
186195

@@ -195,20 +204,22 @@ class UnconnectedMarkerColor extends Component {
195204

196205
return (
197206
<Fragment>
198-
<Field {...this.props} multiValued={this.isMultiValued()} attr={attr}>
199-
<RadioBlocks
200-
options={options}
201-
activeOption={type}
202-
onOptionChange={this.setType}
203-
/>
207+
<Field {...this.props} attr={attr}>
208+
<Field multiValued={this.isMultiValued() && !this.state.type}>
209+
<RadioBlocks
210+
options={options}
211+
activeOption={type}
212+
onOptionChange={this.setType}
213+
/>
204214

205-
{!type ? null : (
206-
<Info>
207-
{type === 'constant'
208-
? _('All points in a trace are colored in the same color.')
209-
: _('Each point in a trace is colored according to data.')}
210-
</Info>
211-
)}
215+
{!type ? null : (
216+
<Info>
217+
{type === 'constant'
218+
? _('All points in a trace are colored in the same color.')
219+
: _('Each point in a trace is colored according to data.')}
220+
</Info>
221+
)}
222+
</Field>
212223

213224
{!type
214225
? null

0 commit comments

Comments
 (0)